コード例 #1
0
 public Task<IList<User>> FindByRoleAsync(Role role)
 {
     return Task.FromResult<IList<User>>(FindByRole(role));
 }
コード例 #2
0
 internal IList<UserProxy> GetUserProxiesByRole(Role role)
 {
     return UnitOfWork.Connection.Query<User>(
         "SELECT u.PasswordHash, u.SecurityStamp, u.UserId, u.UserName FROM [User] u INNER JOIN UserRole ur ON u.UserId = ur.UserId WHERE ur.RoleId = @RoleId",
         param: new { RoleId = role.RoleId },
         transaction: UnitOfWork.Transaction
     ).Select(x => GetUserProxy(x)).ToList();
 }
コード例 #3
0
 public IList<User> FindByRole(Role role)
 {
     var userProxies = GetUserProxiesByRole(role);
     return new List<User>(userProxies);
 }