Fix DbContext

This commit is contained in:
VegaZ
2018-09-23 23:13:05 +02:00
parent a74d080d02
commit 3c527b5f7a
4 changed files with 84 additions and 3 deletions

View File

@@ -40,6 +40,9 @@ namespace reallife_gamemode.Model
public DbSet<Server.Entities.UserVehicle> UserVehicles { get; set; }
public DbSet<Server.Entities.UserBankAccount> BankAccounts { get; set; }
public DbSet<Server.Logs.BankAccountTransactionHistory> BankAccountTransactionHistories { get; set; }
public DbSet<Server.Logs.Death> Deaths { get; set; }
public DbSet<Server.Saves.SavedBlip> Blips { get; set; }
public DbSet<Server.Saves.SavedMarker> Markers { get; set; }
public DbSet<Server.Saves.SavedPed> Peds { get; set; }

View File

@@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
/**
* @overview Life of German Reallife - Entities UserVehicle (UserVehicle.cs)
* @overview Life of German Reallife - Entities UserBankAccount (UserBankAccount.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
@@ -23,10 +23,10 @@ namespace reallife_gamemode.Server.Entities
public int UserId { get; set; }
public User User { get; set; }
[StringLength(12)]
public string bic { get; set; }
public string Bic { get; set; }
[StringLength(32)]
public string Iban { get; set; }
public float Money { get; set; }
public float Balance { get; set; }
public bool Active { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
/**
* @overview Life of German Reallife - Logs BankAccountTransactionHistory (BankAccountTransactionHistory.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Logs
{
public class BankAccountTransactionHistory
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[StringLength(32)]
public string Sender { get; set; }
public float SenderBalance { get; set; }
public float MoneySent { get; set; }
[StringLength(32)]
public string Receiver { get; set; }
public float ReceiverBalance { get; set; }
public float NewSenderBalance { get; set; }
public float NewReceiverBalance { get; set; }
public float Fee { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
}
}

44
Server/Logs/Death.cs Normal file
View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using reallife_gamemode.Server.Entities;
/**
* @overview Life of German Reallife - Logs Death (Death.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Logs
{
public class Death
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[ForeignKey("Killer")]
public int? KillerId { get; set; }
public User Killer { get; set; }
[ForeignKey("Victim")]
public int VictimId { get; set; }
public User Victim { get; set; }
public float KillerPositionX { get; set; }
public float KillerPositionY { get; set; }
public float KillerPositionZ { get; set; }
public float KillerHeading { get; set; }
public float VictimPositionX { get; set; }
public float VictimPositionY { get; set; }
public float VictimPositionZ { get; set; }
public float VictimHeading { get; set; }
[StringLength(64)]
public string CauseOfDeath { get; set; }
[Timestamp]
public byte[] Timestamp { get; set; }
}
}