示例#1
0
 public string DeleteGroup(int Id)
 {
     try
     {
         using (dbContext)
         {
             var group = dbContext.Groups.Find(Id);
             dbContext.Remove(group);
             dbContext.SaveChanges();
             return("Deleted Successfully !");
         }
     }
     catch (Exception ex)
     {
         return(ex.Message.ToString());
     }
 }
示例#2
0
        public string RemoveCustomerAddress(int Id)
        {
            try
            {
                using (dbContext)
                {
                    var delivery = dbContext.Deliveries.Find(Id);

                    if (delivery != null)
                    {
                        dbContext.Remove(delivery);
                        dbContext.SaveChanges();
                    }
                    return("Seccusfully Removed !");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message.ToString());
            }
        }