Replaced string-based entity identifiers in CRUD procedure and command classes with a strongly-typed EntityType enum. Updated all relevant handlers and records to use the new enum property, improving type safety and maintainability. Added necessary using directives and updated documentation comments to reflect these changes.
28 lines
876 B
C#
28 lines
876 B
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.InsertProcedure;
|
|
using ReC.Application.Common.Procedures;
|
|
|
|
namespace ReC.Application.Profile.Commands;
|
|
|
|
public record InsertProfileCommand : IInsertProcedure
|
|
{
|
|
public bool? Active { get; set; }
|
|
public byte? TypeId { get; set; }
|
|
public string? Mandantor { get; set; }
|
|
public string? Name { get; set; }
|
|
public string? Description { get; set; }
|
|
public byte? LogLevelId { get; set; }
|
|
public short? LanguageId { get; set; }
|
|
}
|
|
|
|
public class InsertProfileProcedureHandler(ISender sender) : IRequestHandler<InsertProfileCommand, long>
|
|
{
|
|
public async Task<long> Handle(InsertProfileCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new InsertObjectProcedure
|
|
{
|
|
Entity = EntityType.Profile,
|
|
Profile = request
|
|
}, cancel);
|
|
}
|
|
} |