added editorconfig and formatted code

This commit is contained in:
hydrant
2019-07-17 19:52:55 +02:00
parent ada071cc93
commit 123ab7d07b
146 changed files with 10839 additions and 10715 deletions

View File

@@ -10,42 +10,42 @@ using System.Text;
namespace ReallifeGamemode.Server.Entities
{
public class Group : IBankAccountOwner
public class Group : IBankAccountOwner
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Name { get; set; }
public IBankAccount GetBankAccount(DatabaseContext databaseContext = null)
GroupBankAccount bankAccount = null;
if (databaseContext == null)
{
using (databaseContext = new DatabaseContext())
{
GroupBankAccount bankAccount = null;
if (databaseContext == null)
{
using (databaseContext = new DatabaseContext())
{
bankAccount = databaseContext.GroupBankAccounts.Include(g => g.Group).Where(g => g.Group == this).FirstOrDefault();
}
}
else
{
bankAccount = databaseContext.GroupBankAccounts.Include(g => g.Group).Where(g => g.Group == this).FirstOrDefault();
}
if (bankAccount == null)
{
bankAccount = new GroupBankAccount
{
Group = this,
Balance = 0
};
databaseContext.GroupBankAccounts.Add(bankAccount);
databaseContext.SaveChanges();
}
return bankAccount;
bankAccount = databaseContext.GroupBankAccounts.Include(g => g.Group).Where(g => g.Group == this).FirstOrDefault();
}
}
else
{
bankAccount = databaseContext.GroupBankAccounts.Include(g => g.Group).Where(g => g.Group == this).FirstOrDefault();
}
if (bankAccount == null)
{
bankAccount = new GroupBankAccount
{
Group = this,
Balance = 0
};
databaseContext.GroupBankAccounts.Add(bankAccount);
databaseContext.SaveChanges();
}
return bankAccount;
}
}
}