Files
everything2/EveryThing/Models/CodeTable/CodeTablePrePostText.cs
David Štaleker d0fa4db3d8 Klavzule
2023-06-23 10:10:25 +02:00

37 lines
1001 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using EveryThing.Models.CodeTable;
namespace EveryThing.Models.CodeTable
{
public class CodeTablePrePostText
{
[Key]
public int IdPrePostText { get; set; }
[Required]
[ForeignKey("Company")]
public int IdCompanyFk { get; set; }
[Required]
[Display(Name = "Vsebina")]
public string Content { get; set; }
[NotMapped]
public string ContentDisplay => Content == null ? "" : Content.Length >= 30
? Content.Substring(0, 30)
: Content;
// ForeingKey
public CodeTableCompany Company { get; set; }
// Partner
[InverseProperty("CodeTablePrePostText")]
public virtual ICollection<CodeTablePrePostTextLink> CodeTablePrePostTextLinks { get; set; }
}
}