public Parking.ParkingPlace Update(ParkingPlaceIdentityModel id, ParkingPlaceUpdateModel place) { var existing = this.ApplicationContext.ParkingPlaces.Where(p => p.Id == id.Id).First(); var result = this.Mapper.Map(place, existing); this.ApplicationContext.Update(result); this.ApplicationContext.SaveChanges(); return(this.Mapper.Map <Parking.ParkingPlace>(result)); }
public Parking.ParkingPlace Insert(ParkingPlaceUpdateModel place) { var result = this.ApplicationContext.Add(this.Mapper.Map <DataAccess.Entities.ParkingPlace>(place)); this.ApplicationContext.SaveChanges(); Parking.ParkingPlace res = new Parking.ParkingPlace { Id = result.Entity.Id }; this.Mapper.Map(result.Entity, res); return(res); }
public ParkingPlace CreateParkingPlace(ParkingPlaceUpdateModel place) { return(this.ParkingPlaceDataAccess.Insert(place)); }
public ParkingPlace UpdateParkingPlace(ParkingPlaceIdentityModel id, ParkingPlaceUpdateModel place) { return(this.ParkingPlaceDataAccess.Update(id, place)); }