forked from ddrilling/AsbCloudServer
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
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, IIdWell
|
|
{
|
|
[Key]
|
|
[Column("id")]
|
|
public int Id { get; set; }
|
|
|
|
[Column("id_well"), Comment("id скважины")]
|
|
public int IdWell { get; set; }
|
|
|
|
[Column("id_author"), Comment("Id пользователя, загрузившего файл")]
|
|
public int IdAuthor { 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; }
|
|
|
|
[Column("is_deleted"), Comment("Удален ли файл")]
|
|
public bool IsDeleted { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdWell))]
|
|
public virtual Well Well { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdAuthor))]
|
|
public virtual User User { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdCategory))]
|
|
public virtual FileCategory FileCategory { get; set; }
|
|
}
|
|
} |