public Task<IList<User>> FindByRoleAsync(Role role) { return Task.FromResult<IList<User>>(FindByRole(role)); }
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(); }
public IList<User> FindByRole(Role role) { var userProxies = GetUserProxiesByRole(role); return new List<User>(userProxies); }