EDP .Net开发框架--自动化日志

平台下载地址:https://gitee.com/alwaysinsist/edp


自动化日志不需要额外调用日志相关功能即可无感实现程序集方法调用的日志记录。

  • 创建业务逻辑处理类
    public class StudentBLL : BusinessLogicBase<StudentBLL>
    继承基类BusinessLogicBase< T >
  • 定义业务逻辑方法
点击查看代码
[AutoLog(ActionEnum.Insert, "学生信息")]
public ResultModel<bool> AddStudent(StudentModel item, IDBInstance db = null) { 
    //...
}
ActionEnum:操作行为。
学生信息:当前操作业务对象的名称。

ResultModel<bool> ret = new ResultModel<bool>();

创建通用返回对象。
点击查看代码
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方法。

  • 查看操作日志
    image

    双击行查看详细信息。
    image

posted @ 2024-05-21 19:10  風輕·雲淡  阅读(169)  评论(0编辑  收藏  举报