static void Main(string[] args) { var dbContext = new PlutoDbContext(); var courses = dbContext.GetCourses(); foreach (var course in courses) { Console.WriteLine(course.Description); } }
public static void GetCourses() { using (var dbContext = new PlutoDbContext()) { foreach (var c in dbContext.GetCourses()) { Console.WriteLine(c.Title); } } }
static void Main(string[] args) { var context = new PlutoDbContext(); var courses = context.GetCourses(); foreach (var c in courses) { Console.WriteLine(c.Title); } }
static void Main(string[] args) { var Context = new PlutoDbContext(); var Courses = Context.GetCourses(); foreach (var x in Courses) { Console.WriteLine(x.Title); } Console.ReadLine(); }
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 }
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(); }
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(); }
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; }