Exemplo n.º 1
0
 public static HomeViewModel MapHomeToHomeViewModel(Home home)
 {
     return(new HomeViewModel
     {
         Id = home.Id,
         UserId = home.UserId,
         CityId = home.CityId,
         TotalStairCount = home.TotalStairCount,
         Stair = home.Stair,
         BuildingType = home.BuildingType,
         RoomCount = home.RoomCount,
         Area = home.Area,
         Credit = home.Credit,
         LandArea = home.LandArea,
         Address = home.Address,
         HomeTypeId = home.Id,
         HomeImg = home.HomeImg,
         Price = home.Price,
         EstateDocumentType = home.EstateDocumentType,
         AdverTypeId = home.AdverTypeId,
         AboutHome = home.AboutHome,
         SubmittedByAdmin = home.SubmittedByAdmin,
         City = CityViewModel.MapCityToCityViewModel(home.City),
         // User = UserViewModel.MapUserToUserViewModel(home.User),
         HomeType = HomeTypeViewModel.MapHomeTypeToHomeTypeViewModel(home.HomeType),
         AdverType = AdverTypeViewModel.MapAdverTypeToAdverTypeViewModel(home.AdverType)
                     //  Equipments = home.Equipments.Select(x => EquipmentOfHomeViewModel.MapEquipmentOfHomeToEquipmentOfHomeViewModel(x)).ToList()
     });
 }
Exemplo n.º 2
0
 public static HomeType MapHomeTypeViewModelToHomeType(HomeTypeViewModel vm)
 {
     return(new HomeType
     {
         Id = vm.Id
              //Name = vm.Name
              //Homes=vm.Homes.Select(x=>HomeViewModel.MapHomeViewModelToHome(x)).ToList()
     });
 }