Got a login

This commit is contained in:
Paul Schneider 2023-04-05 22:29:40 +01:00
commit 4b52b6e96e
61 changed files with 7793 additions and 609 deletions

View file

@ -24,20 +24,20 @@ namespace Yavsc.Controllers
// GET: api/ApplicationUserApi
[HttpGet]
public IEnumerable<UserInfo> GetApplicationUser()
public IEnumerable<UserInfo> GetApplicationUser(int skip=0, int take = 25)
{
return _context.Users.OrderByDescending(u => u.DateModified).Take(25)
.Select(u=> new UserInfo {
return _context.Users.Skip(skip).Take(take)
.Select(u=> new UserInfo{
UserId = u.Id,
UserName = u.UserName,
Avatar = u.Avatar });
Avatar = u.Avatar});
}
[HttpGet("search/{pattern}")]
public IEnumerable<UserInfo> SearchApplicationUser(string pattern)
public IEnumerable<UserInfo> SearchApplicationUser(string pattern, int skip=0, int take = 25)
{
return _context.Users.Where(u => u.UserName.Contains(pattern))
.OrderByDescending(u => u.DateModified).Take(25)
.Skip(skip).Take(take)
.Select(u=> new UserInfo {
UserId = u.Id,
UserName = u.UserName,