Profile Page

This commit is contained in:
Andre Beging
2022-05-21 18:22:18 +02:00
parent e71ef30641
commit 5961c06004
12 changed files with 178 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ namespace FoodsharingSiegen.Server.Data
/// <param name="options">The options (ab)</param>
public FsContext(DbContextOptions<FsContext> options) : base(options)
{
Database.EnsureCreated();
// Database.EnsureCreated();
}
#endregion

View File

@@ -144,7 +144,7 @@ namespace FoodsharingSiegen.Server.Data.Service
{
try
{
var entityUser = await Context.Users.FirstOrDefaultAsync(x => x.Id == user.Id);
var entityUser = await Context?.Users?.FirstOrDefaultAsync(x => x.Id == user.Id)!;
if (entityUser == null) return new OperationResult(new Exception("User not found"));
if (entityUser.Mail != user.Mail ||
@@ -155,6 +155,7 @@ namespace FoodsharingSiegen.Server.Data.Service
entityUser.ForceLogout = true;
}
entityUser.Memo = user.Memo;
entityUser.Mail = user.Mail;
entityUser.Name = user.Name;
entityUser.Type = user.Type;