More additions, lucky card based on day, redo of migrations because i messed up

This commit is contained in:
2021-11-01 14:59:36 -04:00
parent 685f09a889
commit 0b94455b4b
48 changed files with 284 additions and 7404 deletions

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using TOOHUCardAPI.Data.Models;
@@ -23,5 +24,10 @@ namespace TOOHUCardAPI.Data.Repositories
return card;
}
public async Task<IEnumerable<Card>> GetAllCards()
{
return await _context.Cards.ToListAsync();
}
}
}

View File

@@ -29,7 +29,7 @@ namespace TOOHUCardAPI.Data.Repositories
.AsQueryable();
}
public async Task<User> GetUser(string steamId, bool allowNull = false)
public async Task<User> GetUser(long steamId, bool allowNull = false)
{
User user = await GetAllUsersQuery().FirstOrDefaultAsync(user => user.SteamId.Equals(steamId));
if (user == null && !allowNull)
@@ -40,7 +40,7 @@ namespace TOOHUCardAPI.Data.Repositories
return user;
}
public async Task<User> CreateUser(string steamId)
public async Task<User> CreateUser(long steamId)
{
User user = new User
{
@@ -77,7 +77,7 @@ namespace TOOHUCardAPI.Data.Repositories
return user;
}
public async Task<User> GetOrCreateUser(string steamId)
public async Task<User> GetOrCreateUser(long steamId)
{
User user = await GetUser(steamId, true) ?? await CreateUser(steamId);
return user;