public Area GetById(Expression <Func <Area, bool> > filter)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.Areas.Include("ActivityLogs").SingleOrDefault(filter));
     }
 }
 public List <Area> GetAll()
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.Set <Area>().ToList());
     }
 }
 public List <Area> GetByAreaType(int typeId)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.Areas.Include("ActivityLogs").Where(a => a.AreaTypeId == typeId).ToList());
     }
 }
Esempio n. 4
0
 public List <ActivityLog> GetById(Expression <Func <ActivityLog, bool> > filter)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.ActivityLogs.Include("Hamster").Where(filter).ToList());
     }
 }
Esempio n. 5
0
 public List <Hamster> GetAll()
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.Hamsters.Include("ActivityLogs").ToList());
     }
 }
Esempio n. 6
0
 public Hamster GetById(int id)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         return(context.Hamsters.Include("ActivityLogs").SingleOrDefault(h => h.Id == id));
     }
 }
 public void Update(Area area)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         var addedEntity = context.Entry(area);
         addedEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Esempio n. 8
0
 public void Add(ActivityLog activityLog)
 {
     using (advYumitGyulerContext context = new advYumitGyulerContext())
     {
         var addedEntity = context.Entry(activityLog);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }
Esempio n. 9
0
        static void Main(string[] args)
        {
            var dbContext = new advYumitGyulerContext();

            dbContext.Database.EnsureCreated();

            Console.Write("How many days do you want the simulation to take?: ");
            int days = int.Parse(Console.ReadLine());

            Console.Write("How fast do you want the simulation to progress?(Tics per second): ");
            int ticksPerSecond = int.Parse(Console.ReadLine());

            Tick tick = new Tick(ticksPerSecond, days);
        }