Пример #1
0
 public void AddMonkeyLog(MonkeyLog x)
 {
     using (var context = new MonkeyDbContext())
     {
         context.MonkeyLogs.Add(x);
         context.SaveChanges();
     }
 }
Пример #2
0
        public int GetLastMonkeyId()
        {
            int lastId = 0;

            using (var context = new MonkeyDbContext())
            {
                int logCount = context.ActionLogs.Count();
                if (logCount > 0)
                {
                    lastId = context.ActionLogs.Select(x => x.MonkeyId).ToList().Max();
                }
            }
            return(lastId);
        }
Пример #3
0
        public int GetLastWoodId()
        {
            int lastId = 0;

            using (var context = new MonkeyDbContext())
            {
                int logCount = context.ActionLogs.Count();
                if (logCount > 0)
                {
                    lastId = context.ActionLogs.ToList().Last().WoodId;
                }
            }
            return(lastId);
        }