Esempio n. 1
0
        static void Main(string[] args)
        {
            var dbContext = new PlutoDbContext();
            var courses   = dbContext.GetCourses();

            foreach (var course in courses)
            {
                Console.WriteLine(course.Description);
            }
        }
Esempio n. 2
0
 public static void GetCourses()
 {
     using (var dbContext = new PlutoDbContext())
     {
         foreach (var c in dbContext.GetCourses())
         {
             Console.WriteLine(c.Title);
         }
     }
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var context = new PlutoDbContext();
            var courses = context.GetCourses();

            foreach (var c in courses)
            {
                Console.WriteLine(c.Title);
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var Context = new PlutoDbContext();

            var Courses = Context.GetCourses();

            foreach (var x in Courses)
            {
                Console.WriteLine(x.Title);
            }
            Console.ReadLine();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            var dbContext = new PlutoDbContext();
            var courses = dbContext.GetCourses();   //CREATE PROC [dbo].[GetCourses] AS SELECT* FROM Courses
            foreach (var coursesResult in courses)
            {
                Console.WriteLine(coursesResult.Title);
            }
            Console.WriteLine("--------------");
            var course = new Course();
            course.Level = CourseLevel.Beginner;   //1

        }
Esempio n. 6
0
 static void Main(string[] args)
 {
     using (var ctx = new PlutoDbContext())
     {
         // used to return now redundant (complex) type GetCourses_Result, but modified to return Course entities
         // check the notes for an awesome way to create your own custom compelx type
         var courses = ctx.GetCourses();
         foreach (var course in courses)
         {
             var level = course.Level;
             Console.WriteLine($"{course.Title} - {level}");
         }
     }
     Console.WriteLine();
     Console.WriteLine("Process complete...");
     Console.ReadLine();
 }
Esempio n. 7
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello");
            var dbContext = new PlutoDbContext();
            var courses   = dbContext.GetCourses();

            foreach (var c in courses)
            {
                Console.WriteLine(c.Title);
            }

            var authorCourses = dbContext.GetAuthorCourses(1);

            var course = new Course();

            //course.Level = CourseLevel.Beginner;

            Console.ReadKey();
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            var dbContext = new PlutoDbContext();

            //dbContext.GetAuthorCourses();

            var courses = dbContext.GetCourses();

            foreach (var c in courses)
            {
                Console.WriteLine(c.Title);
            }



            var course = new Course();

            course.Level = CourseLevel.Beginner; // 1
        }
 public PlutoDataBasePersist(T entity)
 {
     Context = new PlutoDbContext();
     Entity  = entity;
 }