示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
 public ParkingPlace CreateParkingPlace(ParkingPlaceUpdateModel place)
 {
     return(this.ParkingPlaceDataAccess.Insert(place));
 }
 public ParkingPlace UpdateParkingPlace(ParkingPlaceIdentityModel id, ParkingPlaceUpdateModel place)
 {
     return(this.ParkingPlaceDataAccess.Update(id, place));
 }