internal static models.Client MapClientToModel(this entities.Client e) { var m = new models.Client { Addresses = e.Addresses.Select(x => x.MapAddressToModel()).ToList(), Age = e.Age, Emails = e.Emails, Gender = e.Gender, ID = e.ID, Joined = e.Joined, LastName = e.LastName, Name = e.Name, Telephones = e.Telephones.Select(x => x.MapTelephoneToModel()).ToList() }; return(m); }
internal static entities.Client MapClientToEntity(this models.Client m) { var e = new entities.Client { Addresses = m.Addresses.Select(x => x.MapAddressToEntity()).ToList(), Age = m.Age, Emails = m.Emails, Gender = m.Gender, Joined = m.Joined, LastName = m.LastName, Name = m.Name, Telephones = m.Telephones.Select(x => x.MapTelephoneToEntity()).ToList() }; if (!string.IsNullOrWhiteSpace(m.ID)) { e.ID = m.ID; } return(e); }