namespace TravelAgencyWinForms.Models; public sealed class EntityConfig { public string Title { get; init; } = string.Empty; public string TableName { get; init; } = string.Empty; public string? ViewName { get; init; } public string OrderBy { get; init; } = string.Empty; public bool ReadOnly { get; init; } public bool RestrictByCurrentEmployee { get; init; } public string? RestrictColumn { get; init; } public List Fields { get; init; } = new(); public IEnumerable KeyFields => Fields.Where(f => f.IsKey); public IEnumerable GridFields => Fields.Where(f => f.ShowInGrid); public IEnumerable EditableFields => Fields.Where(f => !(f.IsKey && f.AutoIdentity)); public string SourceName => ViewName ?? TableName; }