Skip to content

Instantly share code, notes, and snippets.

using System.Diagnostics.Eventing.Reader;
using System.Security.Principal;
class WhoDidWhatInShare
{
static string logFile = @"C:\Logs\ShareChanges.txt";
static string watchPath = @"C:\Shares\ОбщаяПапка"; // ← измени на свой путь!
static void Main()
{
Наблюдал в EF странное поведение, а именно поведение при трекинге\его отключении. Подготовим 3 варианта и код логирования.
Логирование для просмотра трекинг сущностей:
```c#
private static void LogTrackedEntities(DbContext dbContext)
{
var entries = dbContext.ChangeTracker.Entries()
.Where(e => e.State!=EntityState.Unchanged)
.Select(e => new
{
using System;
using System.Threading;
using System.Threading.Tasks;
using ModelContextProtocol.Protocol.Types;
using ModelContextProtocol.Server;
public class MCPServerWithPing
{
private readonly IMcpServer _server;
private readonly CancellationTokenSource _cancellationTokenSource;
public class ViewModel : INotifyPropertyChanged
{
private ObservableCollection<Item> _items;
public ObservableCollection<Item> Items
{
get => _items;
set
{
_items = value;
OnPropertyChanged(nameof(Items));
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Principal;
using System.Windows;
using System.Windows.Media.Imaging;
using Autodesk.Revit.DB.ExtensibleStorage;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Principal;
using System.Windows;
using System.Windows.Media.Imaging;
using Autodesk.Revit.DB.ExtensibleStorage;
public class IdempotentOperationExecutor
{
private readonly IIdempotencyManagerFactory _factory;
private readonly DbContext _context;
public IdempotentOperationExecutor(IIdempotencyManagerFactory factory, DbContext context)
{
_factory = factory;
_context = context;
}
using Riok.Mapperly.Abstractions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
namespace TestJsonDes;