mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
huge commit for advanced stats feature.
broke data out into its own library. may be breaking changes with existing plugins
This commit is contained in:
39
Data/Models/EFMeta.cs
Normal file
39
Data/Models/EFMeta.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Data.Models.Client;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Data.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// This class encapsulates any meta fields as a simple string
|
||||
/// </summary>
|
||||
public class EFMeta : SharedEntity
|
||||
{
|
||||
public const string ClientTagName = nameof(ClientTagName);
|
||||
public const string ClientTag = nameof(ClientTag);
|
||||
|
||||
[Key]
|
||||
public int MetaId { get; set; }
|
||||
[Required]
|
||||
public DateTime Created { get; set; } = DateTime.UtcNow;
|
||||
[Required]
|
||||
public DateTime Updated { get; set; } = DateTime.UtcNow;
|
||||
public int? ClientId { get; set; }
|
||||
// this is the client that the meta could belong to
|
||||
[ForeignKey(nameof(ClientId))]
|
||||
public virtual EFClient Client { get; set; }
|
||||
[Required]
|
||||
[MinLength(3)]
|
||||
[StringLength(32)]
|
||||
[MaxLength(32)]
|
||||
public string Key { get; set; }
|
||||
[Required]
|
||||
public string Value { get; set; }
|
||||
public string Extra { get; set; }
|
||||
|
||||
public int? LinkedMetaId { get; set; }
|
||||
[ForeignKey(nameof(LinkedMetaId))]
|
||||
public virtual EFMeta LinkedMeta { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user