Пример #1
0
 public void WriteMemoryState(MemoryState memoryState)
 {
     lock (context)
     {
         context.MemoryStatistics.Add(memoryState);
         context.SaveChanges();
     }
 }
Пример #2
0
 protected override void WriteMonitoringResource()
 {
     var memoryState = new MemoryState
     {
         Date = DateTime.Now,
         AvailableMemory = Int32.Parse(performanceCounter.NextValue().ToString(CultureInfo.InvariantCulture))
     };
     writer.WriteMemoryState(memoryState);
 }