afterCreateEntityInterface(
  context: dotnetTypes.DsgContext,
  eventParams: dotnet.CreateEntityInterfaceParams,
  files: FileMap<Interface>
): Promise<FileMap<Interface>> {
  const { entity } = eventParams;
  const interfaceFile = files.get(`Interfaces/I${entity.name}.cs`);
  if (interfaceFile) {
    interfaceFile.code.addMethod(
      CsharpSupport.method({
        name: "Validate",
        returnType: CsharpSupport.Types.boolean(),
      })
    );
  }
  return files;
}

Event Name

CreateEntityInterface

Event Parameters

entity
Entity
The entity object for which the interface is being created.
resourceName
string
The name of the resource (typically the entity name).
apisDir
string
The directory where the API related files are being generated.
moduleContainers
ModuleContainer[]
An array of module containers in the application.
moduleActions
ModuleAction[]
An array of module actions available in the application.
entities
Entity[]
An array of all entities in the application.
afterCreateEntityInterface(
  context: dotnetTypes.DsgContext,
  eventParams: dotnet.CreateEntityInterfaceParams,
  files: FileMap<Interface>
): Promise<FileMap<Interface>> {
  const { entity } = eventParams;
  const interfaceFile = files.get(`Interfaces/I${entity.name}.cs`);
  if (interfaceFile) {
    interfaceFile.code.addMethod(
      CsharpSupport.method({
        name: "Validate",
        returnType: CsharpSupport.Types.boolean(),
      })
    );
  }
  return files;
}