| 1234567891011121314151617181920212223242526272829303132333435 | using System;using System.Linq.Expressions;using System.Windows.Media;using InABox.Configuration;using InABox.Core;namespace PRSDesktop{    public interface IModel    {        Guid ID { get; }    }        public abstract class Model<TModel, TEntity> : IModel where TModel: Model<TModel, TEntity> where TEntity : Entity    {        public Guid ID { get; }        public abstract Columns<TEntity> GetColumns();                public static Columns<TEntity> Columns => (Activator.CreateInstance(typeof(TModel), new object[] { null }) as Model<TModel,TEntity>).GetColumns();                public CoreRow? Row { get; }                protected TType? Get<TType>(Expression<Func<TEntity,TType>> property) => Row != null ? Row.Get<TEntity,TType>(property) : default(TType);                public Model(CoreRow row)        {            Row = row;            ID = Get(x => x.ID);        }            }}
 |