.NET Plugin Events
Create Entity Service Base
Get Started
Lifecycle & Coding Details
Developing a Plugin
Guides & Tutorials
Blueprint Plugin Events
Node.js Plugin Events
- Create Server
- Create Server Docker Compose
- Create Server Docker Compose Dev
- Create Server Dot Env
- Create Server Auth
- Create Package Json
- Create Entity Service
- Create Entity Service Base
- Create Entity Controller
- Create Entity Controller Base
- Create Entity Resolver
- Create Entity Resolver Base
- Create Message Broker Service
- Create Message Broker Service Base
- Create Message Broker NestJS Module
- Create Message Broker Client Options Factory
- Create Message Broker Topics Enum
- Create Prisma Schema
.NET Plugin Events
- Create Server
- Create Server Appsettings
- Create Server Auth
- Create Program File
- Create Server Csproj
- Create Server Docker Compose
- Create Server Git Ignore
- Create Entity Model
- Create Resource Db Context File
- Create Message Broker
- Create Message Broker Client Options Factory
- Create Message Broker Service
- Create Entity Controller
- Create Entity Controller Base
- Create DTOs
- Create Entity Extensions
- Create Entity Interface
- Create Entity Service
- Create Entity Service Base
- Create Seed Development Data File
- Load Static Files
.NET Plugin Events
Create Entity Service Base
Creates a base service for entities in the .NET 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;
}
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;
}
Was this page helpful?
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;
}