public void UpdateCommodity(CommodityViewModel commodity) { var commodityToRemove = _commodityRepository.GetById(commodity.CommodityC); var updateCommodity = Mapper.Map <CommodityViewModel, Commodity_M>(commodity); _commodityRepository.Delete(commodityToRemove); _commodityRepository.Add(updateCommodity); SaveCommodity(); }
public int Delete(string ids) { return(_commodityRepository.Delete(ids)); }
public static bool Delete(int CommodityId) { return(repository.Delete(CommodityId)); }