From 7e90474ac7daf6862a8a707b6600a7c941a79ae9 Mon Sep 17 00:00:00 2001 From: hydrant Date: Thu, 16 May 2019 15:39:30 +0200 Subject: [PATCH] make atm to bank account and bank account owner --- ReallifeGamemode.Server/Entities/ATM.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Entities/ATM.cs b/ReallifeGamemode.Server/Entities/ATM.cs index b98cc4a9..22427592 100644 --- a/ReallifeGamemode.Server/Entities/ATM.cs +++ b/ReallifeGamemode.Server/Entities/ATM.cs @@ -1,8 +1,11 @@ using GTANetworkAPI; +using ReallifeGamemode.Server.Models; +using ReallifeGamemode.Server.Util; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; using System.Text; /** @@ -13,7 +16,7 @@ using System.Text; namespace ReallifeGamemode.Server.Entities { - public class ATM + public class ATM : IBankAccountOwner, IBankAccount { [Key] public int Id { get; set; } @@ -28,5 +31,12 @@ namespace ReallifeGamemode.Server.Entities public bool Faulty { get; set; } = false; public bool Active { get; set; } = true; + public string Name => throw new NotImplementedException(); + + public IBankAccount GetBankAccount(DatabaseContext databaseContext = null) + { + databaseContext = databaseContext ?? new DatabaseContext(); + return databaseContext.ATMs.Where(a => a.Id == this.Id).First(); + } } }