Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            var dbEngine = new DbEngine();

            dbEngine.Execute(@"add Id=000243DE,Title=The Ransom\, \=\\ of \= Zarek,Price=35,Weight=1,Author=Marobar Sul,Skill=Athletics;");
            dbEngine.Execute("add Id=000243EC,Title=The Warp in the West,Price=25,Weight=1,Author=Ulvius Tero,Skill=Block;");

            var dataContext      = new DataContext(dbEngine);
            var checkDataContext = new DataContext(dbEngine);

            var book = dataContext.Read("000243DE");

            Console.WriteLine($"The Author of '{book.Title}' is '{book.Author}'");

            book.Author = "Gor Felim";

            dataContext.SubmitChanges();
            Console.WriteLine("Submitting changes...");

            var actualBook = checkDataContext.Read("000243DE");

            Console.WriteLine($"The Author of '{actualBook.Title}' is '{actualBook.Author}'");

            var book2 = new Book();

            book2.Id     = "000243D0";
            book2.Author = "jan vspisvac";
            dataContext.Insert(book2);
            dataContext.SubmitChanges();
            dataContext.Find("000243D0");
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            var dbEngine = new DbEngine();

            dbEngine.Execute("add Id=000243DE,Title=The Ransom of Zarek,Price=35,Weight=1,Time=02/02/0410 00:00:00,Author=Marobar Sul,Skill=Athletics;");
            dbEngine.Execute("add Id=000243EC,Title=The Warp in the West,Price=25,Weight=1,Time=02/02/0410 01:00:00,Author=Ulvius Tero,Skill=Block;");

            var dataContext      = new DataContext(dbEngine);
            var checkDataContext = new DataContext(dbEngine);

            var book = dataContext.Read <Book>("000243DE");

            Console.WriteLine($"The Author of '{book.Title}' is '{book.Author}'");

            book.Author = "Gor Felim";
            dataContext.SubmitChanges();
            Console.WriteLine("Submitting changes...");

            var actualBook = checkDataContext.Read <Book>("000243DE");

            Console.WriteLine($"The Author of '{actualBook.Title}' is '{actualBook.Author}'");
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            var dbEngine = new DbEngine();

            dbEngine.Execute("add Id=000243DE,Title=The Ransom of Zarek,Price=35,Weight=1,Author=Marobar Sul,Skill=Athletics;");
            dbEngine.Execute("add Id=000243EC,Title=The Warp in the West,Price=25,Weight=1,Author=Ulvius Tero,Skill=Block;");
            dbEngine.Execute(
                "add Id=000A915C,Title=Fighters\\,Guild\\;History\\, 1st\\=Ed\\\\,Price=75,Weight=1,Author=Anonymous,Skill=Heavy Armor;");
            var dataContext      = new DataContext(dbEngine);
            var checkDataContext = new DataContext(dbEngine);

            var book = dataContext.Read <Book>("000A915C");

            Console.WriteLine($"The Author of '{book.Title}' is '{book.Author}'");

            book.Author = "Gor Felim";
            dataContext.SubmitChanges();
            Console.WriteLine("Submitting changes...");

            var actualBook = checkDataContext.Read <Book>("000243DE");

            Console.WriteLine($"The Author of '{actualBook.Title}' is '{actualBook.Author}'");
        }