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

54 lines
1.7 KiB
C#
Raw Normal View History

2022-04-11 18:00:34 +05:00
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model
{
#nullable disable
[Table("t_file_info"), Comment("Файлы всех категорий")]
public class FileInfo : IId, IWellRelated
{
[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 DateTimeOffset UploadDate { get; set; }
[Column("file_size"), Comment("Размер файла")]
public long Size { get; set; }
2022-04-11 18:00:34 +05:00
[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 Author { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdCategory))]
public virtual FileCategory FileCategory { get; set; }
2022-04-11 18:00:34 +05:00
[InverseProperty(nameof(FileMark.FileInfo))]
public virtual ICollection<FileMark> FileMarks { get; set; }
}
}