示例#1
0
        /// <summary>
        /// Delete Vehicle Make
        /// </summary>
        public void DeleteVehicleMake(long vehicleMakeId)
        {
            VehicleMake dbversion = vehicleMakeRepository.Find(vehicleMakeId);

            CheckVehicleMakeAssociations(vehicleMakeId);
            if (dbversion == null)
            {
                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
                                                                  "Vehicle Make with Id {0} not found!", vehicleMakeId));
            }
            vehicleMakeRepository.Delete(dbversion);
            vehicleMakeRepository.SaveChanges();
        }
        public async Task <bool> DeleteVehicleMake(object id)
        {
            try
            {
                await _repository.Delete(id);

                await uow.SaveChangesAsync();

                return(true);
            }
            catch
            {
                return(false);
            }
        }
示例#3
0
 public async Task <int> DeleteVehicleMake(IVehicleMakeDomainModel entity)
 {
     return(await _vehicleMakeRepository.Delete(entity));
 }
示例#4
0
        public async Task <IActionResult> Delete(int id)
        {
            await context.Delete(id);

            return(RedirectToAction("Index"));
        }