平台下载地址:https://gitee.com/alwaysinsist/edp
自动化日志不需要额外调用日志相关功能即可无感实现步伐集方法调用的日志纪录。
- 创建业务逻辑处理类
public class StudentBLL : BusinessLogicBase
继承基类BusinessLogicBase< T >
- 界说业务逻辑方法
点击查看代码- [AutoLog(ActionEnum.Insert, "学生信息")]
- public ResultModel<bool> AddStudent(StudentModel item, IDBInstance db = null) {
- //...
- }
复制代码- ActionEnum:操作行为。
- 学生信息:当前操作业务对象的名称。
复制代码 ResultModel ret = new ResultModel();点击查看代码- StudentModel item = new StudentModel();
- item.Create();
- ret.KeyValue = item.ID;
复制代码- 实例化StudentModel业务对象。
- 调用业务对象Create()方法创建当前业务对象。
- 设置通用返回对象KeyValue值。
复制代码
- 调用业务逻辑方法
private readonly StudentBLL bll_Student = StudentBLL.Create();
创建StudentBLL类实例,通过Create方法创建可实现自动化日志。
var result = this.bll_Student.AddStudent(item);
调用AddStudent方法。
- 查看操纵日志
双击行查看详细信息。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |