定义应用服务接口需要用到的DTO类

本文档详细介绍了如何在ABP框架中创建和使用DTO(数据传输对象)来定义应用服务接口,特别是在处理组织数据查询时。通过创建PagedOrgResultRequestDto、OrgDto和CreateUpdateOrgDto等DTO类,实现对组织信息的分页查询、展示和增删改操作。
摘要由CSDN通过智能技术生成

  定义应用服务接口需要用到的DTO类
  
  为了在进行查询时使用, PagedOrgResultRequestDto被用来将模块数据传递到基础设施层.
  
  1. 在Visual Studio 2017的“解决方案资源管理器”中,右键单击“ABP.TPLMS.Application”项目,在弹出菜单中选择“添加” > “新建文件夹”,并重命名为“Orgs”
  
  2. 使用鼠标右键单击我们刚才创建的“Orgs”文件夹,在弹出菜单中选择“添加” > “新建文件夹”,并重命名为“Dto”。
  
  3.右键单击“Dto”文件夹,然后选择“添加” > “类”。 将类命名为 Paged OrgResultRequestDto,然后选择“添加”。代码如下。
  
  复制代码
  
  using Abp.Application.Services.Dto;
  
  using Abp.Application.Services.Dto;
  
  using System;
  
  using System.Collections.Generic;
  
  using System.Text;
  
  namespace ABP.TPLMS.Orgs.Dto

  复制代码
  
  4.右键单击“Dto”文件夹,然后选择“添加” > “类”。 将类命名为 OrgDto,然后选择“添加”。代码如下。
  
  复制代码
  
  using Abp.Application.Services.Dto;
  
  using Abp.AutoMapper;
  
  using ABP.TPLMS.Entitys;
  
  using System;
  
  using System.Collections.Generic;
  
  using System.Text;
  
  namespace ABP.TPLMS.Orgs.Dto
  
  {
  
  [AutoMapFrom(typeof(Org))]
  
  public class OrgDto : EntityDto<int>
  
  {
  
  int m_parentId = 0;
  
  public string Name { get; set; }
  
  public string HotKey { get; set; }
  
  public int ParentId { get { return m_parentId; } set { m_parentId = value; } }
  
  public string P

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值