From 0c403fbac510ca64c1378de6a0686b5cddab23cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3rka?= Date: Wed, 17 Apr 2019 18:09:40 +0200 Subject: [PATCH] Fix --- Uconomy.csproj | 4 ++-- UconomyEconomyProvider.cs | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Uconomy.csproj b/Uconomy.csproj index ec34cc0..2a6a41a 100644 --- a/Uconomy.csproj +++ b/Uconomy.csproj @@ -29,8 +29,8 @@ false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/UconomyEconomyProvider.cs b/UconomyEconomyProvider.cs index 2b1ffdb..2a47e64 100644 --- a/UconomyEconomyProvider.cs +++ b/UconomyEconomyProvider.cs @@ -124,11 +124,12 @@ public async Task CreateAccountAsync(IUser user) { using (var db = new UconomyDbContext(Plugin)) { - if(await db.Accounts.AnyAsync(a => a.Id == user.Id)) return; - - var account = new Account(user.Id, Plugin.ConfigurationInstance.InitialBalance); - await db.Accounts.AddAsync(account); - await db.SaveChangesAsync(); + if (!await db.Accounts.AnyAsync(a => a.Id == user.Id)) + { + var account = new Account(user.Id, Plugin.ConfigurationInstance.InitialBalance); + await db.Accounts.AddAsync(account); + await db.SaveChangesAsync(); + } } } }