Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string NullString(this Entity e)
- {
- return e?.ToString();
- }
- public class ServiceRequest_Simple : IMapFrom<ServiceRequest>
- {
- public string Room { get; set; } //Room (Entity)
- public string Initiator { get; set; } //User (Entity)
- public void Mapping(Profile profile)
- {
- profile.CreateMap<ServiceRequest, ServiceRequest_Simple>()
- .ForMember(dto => dto.Room, o => o.MapFrom(n => n.Room.NullString()))
- .ForMember(dto => dto.Initiator, o => o.MapFrom(n => n.Initiator.NullString()))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement