mirror of
https://github.com/fergalmoran/EFCore.NamingConventions.git
synced 2025-12-22 09:38:21 +00:00
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
// Copyright (c) .NET Foundation. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
using Microsoft.Data.Sqlite;
|
|
using Microsoft.EntityFrameworkCore.Diagnostics;
|
|
using Microsoft.EntityFrameworkCore.Sqlite.Diagnostics.Internal;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Microsoft.EntityFrameworkCore.TestUtilities;
|
|
|
|
public class SqliteTestHelpers : TestHelpers
|
|
{
|
|
protected SqliteTestHelpers()
|
|
{
|
|
}
|
|
|
|
public static SqliteTestHelpers Instance { get; } = new();
|
|
|
|
public override IServiceCollection AddProviderServices(IServiceCollection services)
|
|
=> services.AddEntityFrameworkSqlite();
|
|
|
|
public override void UseProviderOptions(DbContextOptionsBuilder optionsBuilder)
|
|
=> optionsBuilder.UseSqlite(new SqliteConnection("Data Source=:memory:"));
|
|
|
|
#pragma warning disable EF1001
|
|
public override LoggingDefinitions LoggingDefinitions { get; } = new SqliteLoggingDefinitions();
|
|
#pragma warning restore EF1001
|
|
}
|