feat(dal): тестирование CommitAsync() с отслеживанием изменений
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Constants;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Models;
|
||||
@@ -387,7 +388,59 @@ namespace PARR.DAL.Context
|
||||
|
||||
}
|
||||
|
||||
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
//{
|
||||
// base.OnConfiguring(optionsBuilder);
|
||||
// optionsBuilder.UseLoggerFactory(LoggerFactory.Create(builder =>
|
||||
// {
|
||||
// builder.AddProvider(new MyLoggerProvider());
|
||||
// }));
|
||||
//}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region MyLoggerProvider
|
||||
|
||||
//https://metanit.com/sharp/efcore/2.12.php
|
||||
|
||||
//internal class MyLoggerProvider : ILoggerProvider
|
||||
//{
|
||||
// public ILogger CreateLogger(string categoryName)
|
||||
// {
|
||||
// return new MyLogger();
|
||||
// }
|
||||
|
||||
// public void Dispose()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// private class MyLogger : ILogger, IDisposable
|
||||
// {
|
||||
// public IDisposable? BeginScope<TState>(TState state) where TState : notnull
|
||||
// {
|
||||
// return this;
|
||||
// }
|
||||
|
||||
// public void Dispose()
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
// public bool IsEnabled(LogLevel logLevel)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
|
||||
// {
|
||||
// Console.WriteLine("Привет, как дела? {0}", formatter(state, exception));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user