public IResult Delete(Store store) { var result = _stockStoreDal.GetAll(s => s.StoreId == store.Id); if (result.Count > 0) { return(new ErrorResult(Messages.StoreDoesNotDeleted)); } _storeDal.Delete(store); return(new SuccessResult(Messages.DeletedStore)); }
public string Delete(int id) { Store deleteStore = storeDal.Get(p => p.Id == id); storeDal.Delete(deleteStore); JObject jsonObject = new JObject(); jsonObject.Add("Status", "success"); jsonObject.Add("ErrorMessage", "Kayıt başarıyla silindi."); JArray array = new JArray(); array.Add(jsonObject); return(JsonConvert.SerializeObject(array)); }