public static List <Log> GetAllLogs()
 {
     using (var logServer = new MyLoggingServices())
     {
         return(logServer.Logs.OrderByDescending(p => p.TimeMade.Year).ThenByDescending(p => p.TimeMade.Month).
                ThenByDescending(p => p.TimeMade.Day).ThenByDescending(p => p.TimeMade.Hour).ThenByDescending(p => p.TimeMade.Minute).
                ThenByDescending(p => p.TimeMade.Second).ToList());
     }
 }
 public static void TestLog()
 {
     using (var test = new MyLoggingServices())
     {
         Log temp = new Log();
         test.Logs.Add(temp);
         test.SaveChanges();
     }
 }
 public static void AddLog(string logType    = null, string logMessage = null, int?priority = null,
                           DateTime?timeMade = null, string logObject  = null)
 {
     using (var logServer = new MyLoggingServices())
     {
         Log temp = new Log(logType, logMessage, priority, timeMade, logObject);
         logServer.Logs.Add(temp);
         logServer.SaveChanges();
     }
 }
 public static List <Log> GetLogs(int startFrom = 0, int howMany = 1)
 {
     //TODO DO NOT FORGET TO REMOVE
     Thread.Sleep(2000);
     using (var logServer = new MyLoggingServices())
     {
         return(logServer.Logs.OrderByDescending(p => p.TimeMade.Year).ThenByDescending(p => p.TimeMade.Month).
                ThenByDescending(p => p.TimeMade.Day).ThenByDescending(p => p.TimeMade.Hour).ThenByDescending(p => p.TimeMade.Minute).
                ThenByDescending(p => p.TimeMade.Second).Skip(startFrom).Take(howMany).ToList());
     }
 }