DD.WellWorkover.Cloud/AsbCloudDb/Model/FileInfo.cs
Фролов 962d6e15b6 Fix spelling for defaults.
Replace DateTime to DateTimeOffset in models
2021-12-30 10:45:06 +05:00

56 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model
{
[Table("t_file_info"), Comment("Файлы всех категорий")]
public class FileInfo : 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 DateTimeOffset UploadDate { get; set; }
[Column("file_size"), Comment("Размер файла")]
public long Size { get; set; }
[Column("publish_info", TypeName = "jsonb"), Comment("Информация о файле в облаке")]
public FilePublishInfo PublishInfo { 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 Author { get; set; }
[JsonIgnore]
[ForeignKey(nameof(IdCategory))]
public virtual FileCategory FileCategory { get; set; }
[InverseProperty(nameof(FileMark.FileInfo))]
public virtual ICollection<FileMark> FileMarks { get; set; }
}
}