make atm to bank account and bank account owner

This commit is contained in:
hydrant
2019-05-16 15:39:30 +02:00
parent 397d3c68fc
commit 7e90474ac7

View File

@@ -1,8 +1,11 @@
using GTANetworkAPI; using GTANetworkAPI;
using ReallifeGamemode.Server.Models;
using ReallifeGamemode.Server.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text; using System.Text;
/** /**
@@ -13,7 +16,7 @@ using System.Text;
namespace ReallifeGamemode.Server.Entities namespace ReallifeGamemode.Server.Entities
{ {
public class ATM public class ATM : IBankAccountOwner, IBankAccount
{ {
[Key] [Key]
public int Id { get; set; } public int Id { get; set; }
@@ -28,5 +31,12 @@ namespace ReallifeGamemode.Server.Entities
public bool Faulty { get; set; } = false; public bool Faulty { get; set; } = false;
public bool Active { get; set; } = true; 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();
}
} }
} }