public static ContactDto ConvertToDto(this Domain.DomainModels.Contact.Contact contact) { var returnDto = new ContactDto { Id = contact.Id, EMail = contact.EMail, FirstName = contact.FirstName ?? "N/A", LastName = contact.LastName ?? "N/A", TelephoneNumber_Entry = contact.TelephoneNumber_Entry ?? "N/A", CreatedUtc = contact.CreatedUtc, CreatedBy = contact.CreatedBy ?? "N/A", ModifiedUtc = contact.ModifiedUtc, ModifiedBy = contact.ModifiedBy ?? "N/A" }; return(returnDto); }
public static ContactViewModel ConvertToViewModel(this Domain.DomainModels.Contact.Contact contact) { var returnViewModel = new ContactViewModel { Id = contact.Id, EMail = contact.EMail, FirstName = contact.FirstName ?? "N/A", LastName = contact.LastName ?? "N/A", TelephoneNumber_Entry = contact.TelephoneNumber_Entry ?? "N/A", TotalCount = contact.TotalCount, CreatedUtc = contact.CreatedUtc, ModifiedUtc = contact.ModifiedUtc, Created = contact.CreatedUtc.LocalDateTime, Modified = contact.ModifiedUtc.GetValueOrDefault().LocalDateTime, CreatedBy = contact.CreatedBy ?? "N/A", ModifiedBy = contact.ModifiedBy ?? "N/A", Action = contact.Action }; return(returnViewModel); }