DD.WellWorkover.Cloud/AsbCloudDb/Model/File.cs

43 lines
1.3 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model
{
[Table("t_files"), Comment("Файлы всех категорий")]
public class File : IId
{
[Key]
[Column("id")]
public int Id { get; set; }
[Column("id_well"), Comment("id скважины")]
public int IdWell { get; set; }
[Column("id_user"), Comment("Id пользователя, загрузившего файл")]
public int IdUser { get; set; }
[Column("id_category"), Comment("id категории файла")]
public int IdCategory { get; set; }
[Column("name"), Comment("Название файла")]
public string Name { get; set; }
[Column("date", TypeName = "timestamp with time zone")]
public DateTime Date { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdWell))]
public virtual Well Well { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdUser))]
public virtual User User { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdCategory))]
public virtual FileCategory FileCategory { get; set; }
}
}