MP-PROG
- fix naming DbModels
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.FileData.DbModels
|
||||
{
|
||||
[Table("Macchine")]
|
||||
public partial class ArchMaccModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key]
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
public string RuleName { get; set; } = "";
|
||||
public string Nome { get; set; } = "";
|
||||
public string Descrizione { get; set; } = "";
|
||||
public string BasePath { get; set; } = "";
|
||||
public string ImgUrl { get; set; } = "";
|
||||
public string Note { get; set; } = "";
|
||||
public int ShowOrder { get; set; } = 999;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.FileData.DbModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella archivio dei File Programma
|
||||
/// </summary>
|
||||
[Table("Files")]
|
||||
[Index(nameof(IdxMacchina), nameof(Active), nameof(DiskStatus))]
|
||||
public partial class FileModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int FileId { get; set; }
|
||||
public bool Active { get; set; } = true;
|
||||
public string IdxMacchina { get; set; } = "";
|
||||
public string Name { get; set; } = "";
|
||||
public int Rev { get; set; } = 0;
|
||||
public DateTime LastMod { get; set; }
|
||||
public string UserAppr { get; set; } = "";
|
||||
public long Size { get; set; } = 0;
|
||||
public string Path { get; set; } = "";
|
||||
public string MimeType { get; set; } = "";
|
||||
public string MD5 { get; set; } = "";
|
||||
public FileState DiskStatus { get; set; } = FileState.Ok;
|
||||
public DateTime LastCheck { get; set; } = DateTime.Now.AddYears(-1);
|
||||
public byte[] FileContent { get; set; }
|
||||
|
||||
public ICollection<TagModel> Tags { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FileStringContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return Encoding.UTF8.GetString(FileContent);
|
||||
}
|
||||
set
|
||||
{
|
||||
// serializzo a byte
|
||||
//FileContent = Encoding.ASCII.GetBytes(value);
|
||||
FileContent = Encoding.UTF8.GetBytes(value);
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
public string Extension
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if(!string.IsNullOrEmpty(Name))
|
||||
{
|
||||
int sPos = Name.LastIndexOf('.');
|
||||
answ = Name.Substring(sPos);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
[ForeignKey("IdxMacchina")]
|
||||
public virtual ArchMaccModel Macchina { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.FileData.DbModels
|
||||
{
|
||||
[Table("Tags")]
|
||||
public partial class TagModel
|
||||
{
|
||||
|
||||
[Key]
|
||||
public string TagId { get; set; }
|
||||
|
||||
public ICollection<FileModel> Files { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user