Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
 public static BasePersonViewModel ToViewModel(this PersonV version, DateTime viewDate)
 {
     return(version.ToViewModel <BasePersonViewModel, Person, PersonV>(viewDate));
 }