This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Наблюдал в EF странное поведение, а именно поведение при трекинге\его отключении. Подготовим 3 варианта и код логирования. | |
| Логирование для просмотра трекинг сущностей: | |
| ```c# | |
| private static void LogTrackedEntities(DbContext dbContext) | |
| { | |
| var entries = dbContext.ChangeTracker.Entries() | |
| .Where(e => e.State!=EntityState.Unchanged) | |
| .Select(e => new | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ViewModel : INotifyPropertyChanged | |
| { | |
| private ObservableCollection<Item> _items; | |
| public ObservableCollection<Item> Items | |
| { | |
| get => _items; | |
| set | |
| { | |
| _items = value; | |
| OnPropertyChanged(nameof(Items)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class IdempotentOperationExecutor | |
| { | |
| private readonly IIdempotencyManagerFactory _factory; | |
| private readonly DbContext _context; | |
| public IdempotentOperationExecutor(IIdempotencyManagerFactory factory, DbContext context) | |
| { | |
| _factory = factory; | |
| _context = context; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |