public static PersonV SetData(this PersonV entity, PersonEditorViewModel viewModel) { entity.Forenames = viewModel.Forenames; entity.Surname = viewModel.Surname; entity.SearchText = entity.SetSearchText(); entity.DateOfBirth = viewModel.DateOfBirth; entity.DateOfDeath = viewModel.DateOfDeath; entity.CountryGuid = viewModel.CountryGuid; entity.Height = viewModel.Height; entity.WebAddress = viewModel.WebAddress; return(entity); }
public static string SetSearchText(this PersonV personV) { var fullName = string.IsNullOrEmpty(personV.Forenames) ? personV.Surname.Trim() : string.Format("{0} {1}", personV.Forenames, personV.Surname); return(fullName.RemoveDiacritics()); }
public static BasePersonViewModel ToViewModel(this PersonV version, DateTime viewDate) { return(version.ToViewModel <BasePersonViewModel, Person, PersonV>(viewDate)); }