Converted the SPRID to integer
This commit is contained in:
parent
2c8486f0de
commit
e30aec1791
@ -8,6 +8,6 @@
|
||||
public string? ContactPerson { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? ContactNumber { get; set; }
|
||||
public double SPRID { get; set; }
|
||||
public int SPRID { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,14 +55,21 @@ namespace Marco.Pms.Services.MappingProfiles
|
||||
|
||||
CreateMap<CreateOrganizationDto, Organization>();
|
||||
CreateMap<Organization, OrganizationVM>();
|
||||
CreateMap<Organization, BasicOrganizationVm>();
|
||||
CreateMap<Organization, BasicOrganizationVm>()
|
||||
.ForMember(
|
||||
dest => dest.SPRID,
|
||||
// Explicitly and safely convert double to int
|
||||
opt => opt.MapFrom(src => (int)Math.Round(src.SPRID)));
|
||||
CreateMap<Organization, OrganizationDetailsVM>();
|
||||
CreateMap<OrganizationMongoDB, BasicOrganizationVm>()
|
||||
.ForMember(
|
||||
dest => dest.Id,
|
||||
// Explicitly and safely convert string Id to Guid Id
|
||||
opt => opt.MapFrom(src => new Guid(src.Id))
|
||||
);
|
||||
opt => opt.MapFrom(src => new Guid(src.Id)))
|
||||
.ForMember(
|
||||
dest => dest.SPRID,
|
||||
// Explicitly and safely convert double to int
|
||||
opt => opt.MapFrom(src => (int)Math.Round(src.SPRID)));
|
||||
CreateMap<OrganizationHierarchy, OrganizationHierarchyVM>();
|
||||
|
||||
#endregion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user