Esempio n. 1
0
        /*
         * static void Db4oMain()
         * {
         *      using (IObjectContainer db = Db4oEmbedded.OpenFile("chicken.yap"))
         *      {
         *              //db.Store(new Role() { RoleName = "Chicken", Description = "A prime roasted chicken" });
         *              Console.Write(db.Query<Role>(r => r.RoleName == "chicken")[0].ToString());
         *      }
         *      Console.ReadLine();
         * }
         */

        static void Main(string[] args)
        {
            /*
             * SqlServerProvider provider = new SqlServerProvider();
             * provider.ConnectionString = "Data Source=localhost;Initial Catalog=ReportServer;Integrated Security=True;";
             * provider.Name = "local";
             * Persistence.RegisterProvider(provider);
             *
             * using (Persistence.Connect("local"))
             * {
             *      SqlCommand cmd = SqlServerProvider.CreateCommand("select * from Roles");
             *
             *      using (var reader = new ObjectReader<Role>(cmd, fields => new Role()
             *      {
             *              RoleName = fields["RoleName"] as string,
             *              Description = fields["Description"] as string
             *      }))
             *      {
             *              while (reader.Read())
             *              {
             *                      Console.WriteLine("{0}\n\n", reader.Current);
             *              }
             *      }
             * }
             *
             * Console.ReadLine();
             */

            ObjectModel model = ObjectModel.Load(string.Empty);

            /*
             * XmlProvider provider = new XmlProvider();
             * provider.Mappings = mappings;
             * provider.FileName = @"C:\example.xml";
             *
             * using (Persistence.Connect(provider))
             * {
             *      Persistence.Connection.Save(obj);
             * }
             */
        }