using SharedLibraryCore.Database;
using SharedLibraryCore.Interfaces;
namespace IW4MAdmin.Application.Factories
{
///
/// implementation of the IDatabaseContextFactory interface
///
public class DatabaseContextFactory : IDatabaseContextFactory
{
///
/// creates a new database context
///
/// indicates if entity tracking should be enabled
///
public DatabaseContext CreateContext(bool? enableTracking = true)
{
return enableTracking.HasValue ? new DatabaseContext(disableTracking: !enableTracking.Value) : new DatabaseContext();
}
}
}