Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Feature Request】DyRepository实现一个方法中进行多次查询并映射到返回实体的不同属性 #23

Closed
ElderJames opened this issue Jul 24, 2018 · 1 comment

Comments

@ElderJames
Copy link
Member

鉴于最新版本已支持多查询返回多个对象,现在提议一个特性,就是在DyRepository中的方法执行多条查询时,可以把多个结果映射到一个实体的不同属性上。

例如返回类型是以下类型:

    public class PagedData<TRecord>
    {
        public PagedData()
        {
        }

        public PagedData(int pageSize, int pageNow)
        {
            PageSize = pageSize;
            PageNow = pageNow;
            TotalCount = 0;
            Records = Enumerable.Empty<TRecord>();
        }

        public int PageSize { get; set; }

        public int PageNow { get; set; }

        public int TotalCount { get; set; }

        public IEnumerable<TRecord> Records { get; set; }
    }

那么会进行两次查询:

  1. 先查询总记录数,结果映射到TotalCount上
  2. 再查询分页的记录,结果映射到Records 上
@Ahoo-Wang
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SmartSqlPlan
  
Done
Development

No branches or pull requests

2 participants