Example #1
0
        static void Main(string[] args)
        {
            var repo      = new BarsRepo();
            var dateToday = DateTime.Today;
            int flag      = 234;//GetFlag(dateToday.DayOfWeek);

            using (BarsDbContext db = new BarsDbContext())
            {
                var openBarsToday = db.Bars
                                    .Where(x => x.OpeningDay < dateToday)
                                    .Where(x => IsOpen(x, dateToday.DayOfWeek));

                //Print
                foreach (var bar in openBarsToday)
                {
                    Console.WriteLine(bar.Name);
                }
            }

            //using (BarsDbContext db = new BarsDbContext())
            //{
            //    var openBarsToday = db.Bars
            //        .Where(x => x.OpeningDay < dateToday)
            //        .Where(x => (x.OpenWeekDays | flag) > 0);


            //    //Print
            //    foreach (var bar in openBarsToday)
            //    {
            //        Console.WriteLine(bar.Name);
            //    }
            //}

            //var openBarsToday = repo.GetAll()
            //       .Where(x => x.OpeningDay.Date < dateToday)
            //       .Where(x => x.IsOpen(dateToday.DayOfWeek));
            ////.Where(x => x.OpenWeekDays.HasFlag(dateToday.DayOfWeek));

            ////Print
            //foreach (var bar in openBarsToday)
            //{
            //    Console.WriteLine(bar.Name);
            //}

            //Console.Read();
        }
Example #2
0
        static void Main(string[] args)
        {
            var repo = new BarsRepo();
            var dateToday = DateTime.Today;
            int flag = 234;//GetFlag(dateToday.DayOfWeek);

            using (BarsDbContext db = new BarsDbContext())
            {
                var openBarsToday = db.Bars
                    .Where(x => x.OpeningDay < dateToday)
                    .Where(x => IsOpen(x, dateToday.DayOfWeek));

                //Print
                foreach (var bar in openBarsToday)
                {
                    Console.WriteLine(bar.Name);
                }
            }

            //using (BarsDbContext db = new BarsDbContext())
            //{
            //    var openBarsToday = db.Bars
            //        .Where(x => x.OpeningDay < dateToday)
            //        .Where(x => (x.OpenWeekDays | flag) > 0);

            //    //Print
            //    foreach (var bar in openBarsToday)
            //    {
            //        Console.WriteLine(bar.Name);
            //    }
            //}

            //var openBarsToday = repo.GetAll()
            //       .Where(x => x.OpeningDay.Date < dateToday)
            //       .Where(x => x.IsOpen(dateToday.DayOfWeek));
            ////.Where(x => x.OpenWeekDays.HasFlag(dateToday.DayOfWeek));

            ////Print
            //foreach (var bar in openBarsToday)
            //{
            //    Console.WriteLine(bar.Name);
            //}

            //Console.Read();
        }