public OperationFeedBack <bool> DeleteWithFeedBack(DTO dto) { OperationFeedBack <Boolean> result = null; IBaseService <DTO, Entity> service = this.CreateClient(); ICommunicationObject communicationObject = service as ICommunicationObject; ExtensionMethod.UsingEx <ICommunicationObject>(communicationObject, delegate(ICommunicationObject client) { result = service.DeleteWithFeedBack(dto); }); return(result); }
public OperationFeedBack <bool> DeleteWithFeedBack(DTO dto) { OperationFeedBack <Boolean> result = new OperationFeedBack <bool>(); result.OperationResult = false; result.InputArguments = "dto = 【" + dto.ToString() + "】"; Entity t = dto.MapTo <Entity>(); try { result.OperationResult = this.baseBLL.Delete(t); } catch (Exception ex) { result.OperationSuccess = false; result.FailReasonDescription = "删除记录过程出现异常。"; result.ExceptionInst = new OperationException(ex); return(result); } result.OperationSuccess = true; return(result); }