Ejemplo n.º 1
0
        public int Update(VehicleRepairingItem model)
        {
            Mapper.CreateMap <VehicleRepairingItem, VehicleRepairing>();
            VehicleRepairing objRepairing = DbContext.VehicleRepairings.SingleOrDefault(m => m.ID == model.ID);

            objRepairing = Mapper.Map(model, objRepairing);
            return(DbContext.SaveChanges());
        }
Ejemplo n.º 2
0
        public VehicleRepairingItem GetById(int id)
        {
            Mapper.CreateMap <VehicleRepairing, VehicleRepairingItem>();
            VehicleRepairing     objRepairing   = DbContext.VehicleRepairings.SingleOrDefault(m => m.ID == id);
            VehicleRepairingItem objVehicleItem = Mapper.Map <VehicleRepairingItem>(objRepairing);

            return(objVehicleItem);
        }
Ejemplo n.º 3
0
 public int Insert(VehicleRepairingItem model)
 {
     try
     {
         Mapper.CreateMap <VehicleRepairingItem, VehicleRepairing>();
         VehicleRepairing objVehicle = Mapper.Map <VehicleRepairing>(model);
         DbContext.VehicleRepairings.Add(objVehicle);
         return(DbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw;
     }
 }