using System.ComponentModel.DataAnnotations.Schema; namespace YLErp.DBModels { [Table("trade_file")] public class trade_file : DBModelWithOperator { public static string LogClass = "交易文件管理"; /// /// 交易id /// [DisplayName("交易id")] public int? TradeId { set; get; } /// /// 文件描述 /// [DisplayName("文件描述")] public string Description { set; get; } = ""; /// /// 文件路径 /// [DisplayName("文件路径")] public string Path { set; get; } = ""; [NotMapped] [DisplayName("文件")] public string FileName { get { var splitStr = Path.Contains(@"\") ? @"\" : "/"; var fileNameIndex = Path.LastIndexOf(splitStr); if (fileNameIndex >= 0) { return Path.Substring(fileNameIndex + 1); } return ""; } } } }