public object Delete(string guid) { using (var dal = new DalService()) { var existingItem = dal.ContentLimitItems .FirstOrDefault(r => r.Guid.Equals(guid, StringComparison.OrdinalIgnoreCase)); if (existingItem == null) { return(new { isSuccess = false, messages = new string[] { "Could not find item to delete" } }); } dal.Remove(existingItem); dal.SaveChanges(); return(new { isSuccess = true }); } }