Example #1
0
 private static void LinQuery(SoftUniContext context)
 {
     Console.WriteLine(context.Projects.Where(p => p.StartDate.Year > 2002).Count());
 }
Example #2
0
        private static void NativeQuery(SoftUniContext context)
        {
            int result = context.Database.SqlQuery <int>("Select Count (*) FROM Projects Where Year(StartDate)>2002").First();

            Console.WriteLine(result);
        }