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方法。

  • 查看操作日志

    双击行查看详细信息。

相关推荐
風輕·雲淡4 个月前
EDP .Net开发框架--组织架构
开发框架·.net开发框架·组织架构
風輕·雲淡4 个月前
EDP .Net开发框架--WebApi
webapi·.net开发框架
風輕·雲淡4 个月前
EDP .Net开发框架--权限
权限框架·.net开发框架
風輕·雲淡4 个月前
EDP .Net开发框架--业务模型
开发框架·权限框架·.net开发框架
風輕·雲淡4 个月前
推荐一个好用的.net开发框架
开发框架·webapi·权限框架·.net开发框架