2021-06-16

.net后端随笔

实体:
createDto: public class xx :EntityDto<string>
GetListDto: public class xx :EntityDto<string>
PGetListDto: public class xx :PagedAndSortedResultRequestDto

接口:
查询:Task<PagedResultDto<TQMBM020_GetList01_Dto>> GetPageList(TQMBM020_P_GetList01_Dto qMBM020_P_GetList01_Dto);
新增:Task<ReturnResult> Create01Async(TQMBM020_Create01_Dto qMBM020_Create01_Dto);
修改:Task<ReturnResult> Update01Async(TQMBM020_GetList01_Dto qMBM020_GetList01_Dto);
删除:Task<ReturnResult> DeleteTQMBM020Async(List<string> uUIDs);

控制器:
 [Route("api/bm/tqmbm020")]
依赖注入:private ITQMBM020AppService TQMBM020AppService { get; set; }
       public TQMBM020Controller(ITQMBM020AppService TQMBM020AppService)
        {
            this.TQMBM020AppService = TQMBM020AppService;
        }

查询:
        [HttpGet]
        [Route("getpagelist")]
        public virtual async Task<PagedResultDto<TQMBM020_GetList01_Dto>> GetPageList(TQMBM020_P_GetList01_Dto qMBM020_P_GetList01_Dto)
        {
            return await TQMBM020AppService.GetPageList(qMBM020_P_GetList01_Dto);
        }

新增:
        [HttpPost]
        [Route("create01async")]
        public virtual async Task<ReturnResult> Create01Async(TQMBM020_Create01_Dto qMBM020_Create01_Dto)
        {
            return await TQMBM020AppService.Create01Async(qMBM020_Create01_Dto);
        }

修改:
        [HttpPost]
        [Route("update01async")]
        public virtual async Task<ReturnResult> Update01Async(TQMBM020_GetList01_Dto qMBM020_GetList01_Dto)
        {
            return await TQMBM020AppService.Update01Async(qMBM020_GetList01_Dto);
        }

删除:
        [HttpDelete]
        [Route("delete01async")]
        public virtual async Task Delete01Async(List<string> ids)
        {
             await TQMBM020AppService.Delete01Async(ids);
        }

方法:AppService
          private IRepository<Tqmbm000, string> TQMBM000_Repository { get; set; }
                   public TQMBM020AppService(IRepository<Tqmbm020, string> repository_TQMBM020, IRepository<Tqmbm000, string> repository_TQMBM000,IClock clock)
                     {
                           this.TQMBM020_Repository = repository_TQMBM020;
                           this.TQMBM000_Repository = repository_TQMBM000;
                      }

上一篇:P36 排序(上)


下一篇:abpvnext密码强度及DTO的属性首字母保持小写设置