public OperationResult Delete(string ProductNo, string RelatedID) { var model = PROD_RELATEDITEMList.FirstOrDefault(t => t.ProductNo == ProductNo && t.RelatedID == RelatedID); PROD_RELATEDITEMRepository.Delete(model); return(new OperationResult(OperationResultType.Success, "successfully deleted")); }
public OperationResult Update(UpdatePROD_RELATEDITEMModel model) { var entity = PROD_RELATEDITEMList.First(t => t.ProductNo == model.ProductNo && t.RelatedID == model.RelatedID); entity.ProductNo = model.ProductNo; entity.RelatedID = model.RelatedID; entity.Ranking = model.Ranking; PROD_RELATEDITEMRepository.Update(entity); return(new OperationResult(OperationResultType.Success, "update completed")); }