Added account management sites
This commit is contained in:
parent
c8252daf88
commit
7113e3abee
10 changed files with 332 additions and 64 deletions
|
@ -1,4 +1,5 @@
|
|||
using Lieb.Models;
|
||||
using Lieb.Models.GuildWars2;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Lieb.Data
|
||||
|
@ -52,5 +53,21 @@ namespace Lieb.Data
|
|||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
public async Task EditUser(LiebUser user)
|
||||
{
|
||||
using var context = _contextFactory.CreateDbContext();
|
||||
LiebUser? userToChange = context.LiebUsers
|
||||
.Include(u => u.GuildWars2Accounts)
|
||||
.FirstOrDefault(u => u.LiebUserId == user.LiebUserId);
|
||||
|
||||
if(userToChange != null)
|
||||
{
|
||||
userToChange.Name = user.Name;
|
||||
userToChange.Pronouns = user.Pronouns;
|
||||
userToChange.Birthday = user.Birthday;
|
||||
}
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue