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? ContactPerson { get; set; }
|
||||||
public string? Address { get; set; }
|
public string? Address { get; set; }
|
||||||
public string? ContactNumber { 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<CreateOrganizationDto, Organization>();
|
||||||
CreateMap<Organization, OrganizationVM>();
|
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<Organization, OrganizationDetailsVM>();
|
||||||
CreateMap<OrganizationMongoDB, BasicOrganizationVm>()
|
CreateMap<OrganizationMongoDB, BasicOrganizationVm>()
|
||||||
.ForMember(
|
.ForMember(
|
||||||
dest => dest.Id,
|
dest => dest.Id,
|
||||||
// Explicitly and safely convert string Id to Guid 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>();
|
CreateMap<OrganizationHierarchy, OrganizationHierarchyVM>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user