mirror of
https://github.com/DevExpress/netcore-winforms-demos.git
synced 2025-12-25 19:07:30 +00:00
23 lines
801 B
C#
23 lines
801 B
C#
using System;
|
|
using System.Linq;
|
|
using DevExpress.Mvvm.DataModel;
|
|
#if DXCORE3
|
|
using DevExpress.Mvvm.DataModel.EFCore;
|
|
#else
|
|
using DevExpress.Mvvm.DataModel.EF6;
|
|
#endif
|
|
|
|
namespace DevExpress.DevAV.DevAVDbDataModel {
|
|
/// <summary>
|
|
/// Provides methods to obtain the relevant IUnitOfWorkFactory.
|
|
/// </summary>
|
|
public static class UnitOfWorkSource {
|
|
/// <summary>
|
|
/// Returns the IUnitOfWorkFactory implementation.
|
|
/// </summary>
|
|
public static IUnitOfWorkFactory<IDevAVDbUnitOfWork> GetUnitOfWorkFactory() {
|
|
Func<DevAVDb> contextFactory = () => new DevAVDb(@"Data Source=..\Data\devav.sqlite3");
|
|
return new DbUnitOfWorkFactory<IDevAVDbUnitOfWork>(() => new DevAVDbUnitOfWork(contextFactory));
|
|
}
|
|
}
|
|
} |