2021-03-22 12:09:25 -04:00
|
|
|
|
using Data.Models.Client;
|
|
|
|
|
using System;
|
2018-06-02 00:48:10 -04:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
2021-03-22 12:09:25 -04:00
|
|
|
|
namespace Data.Models
|
2018-06-02 00:48:10 -04:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This class encapsulates any meta fields as a simple string
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class EFMeta : SharedEntity
|
|
|
|
|
{
|
2021-01-24 12:47:19 -05:00
|
|
|
|
public const string ClientTagName = nameof(ClientTagName);
|
|
|
|
|
public const string ClientTag = nameof(ClientTag);
|
|
|
|
|
|
2018-06-02 00:48:10 -04:00
|
|
|
|
[Key]
|
|
|
|
|
public int MetaId { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public DateTime Created { get; set; } = DateTime.UtcNow;
|
|
|
|
|
[Required]
|
|
|
|
|
public DateTime Updated { get; set; } = DateTime.UtcNow;
|
2021-01-24 12:47:19 -05:00
|
|
|
|
public int? ClientId { get; set; }
|
|
|
|
|
// this is the client that the meta could belong to
|
|
|
|
|
[ForeignKey(nameof(ClientId))]
|
2018-06-02 00:48:10 -04:00
|
|
|
|
public virtual EFClient Client { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
[MinLength(3)]
|
2019-02-22 20:35:03 -05:00
|
|
|
|
[StringLength(32)]
|
|
|
|
|
[MaxLength(32)]
|
2018-06-02 00:48:10 -04:00
|
|
|
|
public string Key { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public string Value { get; set; }
|
|
|
|
|
public string Extra { get; set; }
|
2021-01-24 12:47:19 -05:00
|
|
|
|
|
|
|
|
|
public int? LinkedMetaId { get; set; }
|
|
|
|
|
[ForeignKey(nameof(LinkedMetaId))]
|
|
|
|
|
public virtual EFMeta LinkedMeta { get; set; }
|
2018-06-02 00:48:10 -04:00
|
|
|
|
}
|
|
|
|
|
}
|