Esempio n. 1
0
            public DB MakeDB()
            {
                try { System.IO.Directory.Delete(DBAddress, true); } catch { }

                MakeDB(ref SimpleDatas, "KeyValueDatas", (c) => c.Name);

                MakeDB(ref Groups, "Groups", (c) => c.Name);
                (Groups.Relation((c) => c.GroupParents, (c) => c.IsUpdateAble = ISUpdateAble),
                 Groups.Relation((c) => c.GroupChilds, (c) => c.IsUpdateAble = ISUpdateAble)).Join();

                MakeDB(ref Products, "Products", (c) => c.ProductName);
                (Products.Relation((c) => c.GroupParents, (c) => c.IsUpdateAble = ISUpdateAble),
                 Groups.Relation((c) => c.ProductChilds, (c) => c.IsUpdateAble = ISUpdateAble)).Join();

                MakeDB(ref GameDatas, "GameDatas", (c) => (string)c.Product.Key);
                (GameDatas.Relation((c) => c.Product, (c) => c.IsChild = true),
                 Products.Relation((c) => c.Game, (c) => c.IsUpdateAble = ISUpdateAble)).Join();

                MakeDB(ref GameImages, "GameImages", (c) => (string)c.Product.Key);
                (GameImages.Relation((c) => c.Product, (c) => c.IsChild = true),
                 Products.Relation((c) => c.Image, (c) => c.IsUpdateAble = ISUpdateAble)).Join();

                return(this);
            }