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(); + } } }