Пример #1
0
 public static OrganizationModel ToModel(this AddOrganizationViewModel viewModel)
 {
     return(new OrganizationModel()
     {
         Name = viewModel.Name,
         Categories = viewModel.Categories,
         PhoneNumber = viewModel.PhoneNumber,
         Address = new AddressModel()
         {
             Latitude = viewModel.Latitude,
             Longitude = viewModel.Longitude,
             Street = viewModel.StreetName,
             StreetNumber = viewModel.StreetNumber
         },
         Active = true
     });
 }
Пример #2
0
        public static AddOrganizationViewModel Map(this OrganizationModel model)
        {
            var result = new AddOrganizationViewModel()
            {
                Name         = model.Name,
                Categories   = model.Categories,
                PhoneNumber  = model.PhoneNumber,
                Latitude     = model.Address.Latitude,
                Longitude    = model.Address.Longitude,
                StreetName   = model.Address.Street,
                StreetNumber = model.Address.StreetNumber,
                Id           = model.Id
            };

            result.SetValidationResult(model.ValidationResult);

            return(result);
        }