Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.amplication.com/llms.txt

Use this file to discover all available pages before exploring further.

Event Name

CreateDTOs

Event Parameters

entity
Entity
The entity object for which DTOs are being created.
dtoName
string
The name of the DTO class to be created.
dtoBasePath
string
The base path where DTO files are generated.
afterCreateDTOs(
  context: dotnetTypes.DsgContext,
  eventParams: dotnet.CreateDTOsParams,
  files: FileMap<Class>
): Promise<FileMap<Class>> {
  const { entity, dtoName } = eventParams;
  const dtoFile = files.get(`DTOs/${dtoName}.cs`);
  if (dtoFile) {
    dtoFile.code.addProperty(
      CsharpSupport.property({
        name: "LastModified",
        type: CsharpSupport.Types.dateTime(),
      })
    );
  }
  return files;
}