Beispiel #1
0
        static void T5(LIBRARYEntities ctx)
        {
            //var r = ctx.Books.Where(q => q.Language_id);

            //foreach (var i in r)
            //{
            //    Console.WriteLine(i.Id + "|" + i.Language_id + "|" + i.Pages_count + "|" + i.Book_Name + "|" + i.Author_Id);
            //}
        }
Beispiel #2
0
        static void T4(LIBRARYEntities ctx)
        {
            var r = from book in ctx.Books join author in ctx.Authors on book.Author_Id equals author.Id

                    foreach (var i in r)
            {
                Console.WriteLine(i.Id + "|" + i.Language_id + "|" + i.Pages_count + "|" + i.Book_Name + "|" + i.Author_Id);
            }
        }
Beispiel #3
0
        static void T2(LIBRARYEntities ctx)
        {
            var r = ctx.Books.Where(q => q.Book_Name.StartsWith("A") || q.Book_Name.StartsWith("a"));

            foreach (var i in r)
            {
                Console.WriteLine(i.Id + "|" + i.Language_id + "|" + i.Pages_count + "|" + i.Book_Name + "|" + i.Author_Id);
            }
        }
Beispiel #4
0
        static void T3(LIBRARYEntities ctx)
        {
            var r = ctx.Books.Where(q => q.Book_Name.Length < 10);

            foreach (var i in r)
            {
                Console.WriteLine(i.Id + "|" + i.Language_id + "|" + i.Pages_count + "|" + i.Book_Name + "|" + i.Author_Id);
            }
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            LIBRARYEntities ctx = new LIBRARYEntities();

            //T1(ctx);

            //T2(ctx);

            //T3(ctx);


            ctx.SaveChanges();
            ctx.Dispose();
        }