Event Name
CreateEntityServiceBase
Event Parameters
The entity object for which the base service is being created.
The name of the resource (typically the entity name).
The directory where the API services are being generated.
An array of module actions available for the entity.
An array of all entities in the application.
afterCreateEntityServiceBase(
context: dotnetTypes.DsgContext,
eventParams: dotnet.CreateEntityServiceBaseParams,
files: FileMap<Class>
): Promise<FileMap<Class>> {
const { entity } = eventParams;
const serviceBaseFile = files.get(`Services/Base/${entity.name}ServiceBase.cs`);
if (serviceBaseFile) {
serviceBaseFile.code.addMethod(
CsharpSupport.method({
name: "SoftDelete",
access: "protected",
returnType: CsharpSupport.Types.task(CsharpSupport.Types.void()),
parameters: [
CsharpSupport.parameter({
name: "id",
type: CsharpSupport.Types.string(),
}),
],
body: "// Implement soft delete logic here",
})
);
}
return files;
}