using System; using System.Linq; using DevExpress.Mvvm.DataModel; using DevExpress.Mvvm.ViewModel; namespace DevExpress.DevAV.Common.ViewModel { /// /// The base class for POCO view models exposing a single entity of a given type and CRUD operations against this entity. /// This is a partial class that provides the extension point to add custom properties, commands and override methods without modifying the auto-generated code. /// /// An entity type. /// A primary key value type. /// A unit of work type. public abstract partial class SingleObjectViewModel : SingleObjectViewModelBase where TEntity : class where TUnitOfWork : IUnitOfWork { /// /// Initializes a new instance of the SingleObjectViewModel class. /// /// A factory used to create the unit of work instance. /// A function that returns the repository representing entities of a given type. /// An optional parameter that provides a function to obtain the display text for a given entity. If ommited, the primary key value is used as a display text. protected SingleObjectViewModel(IUnitOfWorkFactory unitOfWorkFactory, Func> getRepositoryFunc, Func getEntityDisplayNameFunc = null) : base(unitOfWorkFactory, getRepositoryFunc, getEntityDisplayNameFunc) { } } }