36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using reallife_gamemode.Model;
|
|
using reallife_gamemode.Server.Util;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace reallife_gamemode.Server.Entities
|
|
{
|
|
public class Business : IBankAccountOwner
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public IBankAccount GetBankAccount (DatabaseContext databaseContext = null)
|
|
{
|
|
if (databaseContext == null)
|
|
{
|
|
using (databaseContext = new DatabaseContext())
|
|
{
|
|
return databaseContext.BusinessBankAccounts.FirstOrDefault(u => u.BusinessId == this.Id);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return databaseContext.BusinessBankAccounts.FirstOrDefault(u => u.BusinessId == this.Id);
|
|
}
|
|
}
|
|
}
|
|
}
|