예제 #1
0
 public ResponseModel DeleteeliveryManCustomerTag(DeliveryManCustomerTagViewModel model)
 {
     try
     {
         var local = DbContext.Set <DeliveryManCustomerTag>().Local.FirstOrDefault(c => c.Id == model.Id);
         if (local != null)
         {
             DbContext.Entry(local).State = System.Data.Entity.EntityState.Detached;
         }
         var existingData = DbContext.DeliveryManCustomerTag.Where(r => r.Id == model.Id).FirstOrDefault();
         DbContext.Entry(existingData).State = System.Data.Entity.EntityState.Deleted;
         DbContext.SaveChanges();
     }
     catch (Exception ex)
     {
         return(new ResponseModel {
             Success = false, Message = "Can not be delete. Using on transaction."
         });
     }
     return(new ResponseModel {
         Success = true, Message = "Success"
     });
 }
예제 #2
0
 public IHttpActionResult DeleteDeliveryManCustomerTag([FromBody] DeliveryManCustomerTagViewModel model)
 {
     return(Ok(_userCredientialRepository.DeleteeliveryManCustomerTag(model)));
 }