IW4M-Admin/Application/Factories/DatabaseContextFactory.cs
RaidMax 5529858edd [misc bug fixes]
properly hide broadcast failure messages if ignore connection lost is turned on
fix concurent issue for update stats history that happened with new event processing
make get/set additional property thread safe
add ellipse to truncated chat messages on home
2020-04-25 19:01:26 -05:00

22 lines
739 B
C#

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