!INFO: tried to move to postgreSQL did not work
fix: fixed bumping, fixed banning from Reports Menu feat: improved homepage, finilized comments and posts, moved version from nav menu to sidebar Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
7bd31ea7b5
commit
73be698399
12 changed files with 188 additions and 47 deletions
|
@ -14,7 +14,7 @@ public static class UsersRepository
|
|||
.Include(user => user.Posts)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
public static async Task<UserData> getUserByIdAsync(int userId)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
|
@ -27,6 +27,14 @@ public static class UsersRepository
|
|||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public static async Task<UserData> getUserByIdLiteAsync(int userId)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
return await db.Users
|
||||
.Where(x => x.UserID == userId)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public static async Task<UserData> getUserByEmailRawAsync(string email)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
|
@ -34,7 +42,7 @@ public static class UsersRepository
|
|||
.Where(user => user.Email == email)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
|
||||
public static async Task<UserData> getUserByEmailAsync(string email)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
|
@ -59,14 +67,14 @@ public static class UsersRepository
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
public static async Task<bool> updateUserAsync(UserData userToUpdate)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
db.Users.Update(userToUpdate);
|
||||
return await db.SaveChangesAsync() >= 1;
|
||||
}
|
||||
|
||||
|
||||
public static async Task<bool> deleteUserAsync(int userId)
|
||||
{
|
||||
await using var db = new AppDBContext();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue