Esempio n. 1
0
        public ResponseViewModel Delete(int id)
        {
            var response = new ResponseViewModel();

            var vehicleType = _vehicleTypeDal.GetVehicleType(p => p.Id == id);

            if (vehicleType == null)
            {
                response.IsSuccess = false;
                response.Message   = "vehicleType bulunamadı.";
                return(response);
            }

            vehicleType.IsDeleted = true;

            _vehicleTypeDal.Update(vehicleType);
            var saving = _vehicleTypeDal.SaveChanges();

            if (!saving)
            {
                response.IsSuccess = false;
                response.Message   = "vehicleType silme işlemi sırasında hata oluştu.";

                return(response);
            }

            response.Data = vehicleType;

            return(response);
        }
 //[CacheRemoveAspect("IVehicleTypeService.Get")]
 //[SecuredOperation("user")]
 public IResult Update(VehicleType vehicleType)
 {
     _vehicleTypeDal.Update(vehicleType);
     return(new SuccessResult(Messages.TypeUpdated));
 }