コード例 #1
0
        private void SeedBikeTagTypes(ISeedContext seedContext)
        {
            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeBikeFrame).ExtendWith(new TagType()
            {
                Name       = "Frame",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeBikeFrontFork).ExtendWith(new TagType()
            {
                Name       = "Front Fork",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeBikeShifters).ExtendWith(new TagType()
            {
                Name       = "Shifters",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeFrontDerailleur).ExtendWith(new TagType()
            {
                Name       = "Front Derailleur",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeRearDerailleur).ExtendWith(new TagType()
            {
                Name       = "Rear Derailleur",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeCrankset).ExtendWith(new TagType()
            {
                Name       = "Crankset",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeBottomBracket).ExtendWith(new TagType()
            {
                Name       = "Bottom Bracket",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeChain).ExtendWith(new TagType()
            {
                Name       = "Chain",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));

            seedContext.Add(seedContext.BuildWrappedObject <TagType>(SeedingStrings.TagTypeCassette).ExtendWith(new TagType()
            {
                Name       = "Cassette",
                Categories = seedContext.GetObjectsForAlias <Category>(SeedingStrings.CategoryBks)
            }.TimeStampNew()));
        }
コード例 #2
0
        public void AddBikeCategories(ISeedContext seedContext)
        {
            //TODO : Add parent id for all categories
            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBks)
                .ExtendWith(new Category()
            {
                Name   = "Bikes",
                Parent = seedContext.GetObjectForAlias <Category>(SeedingStrings.CAT_Product),
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBksCross)
                .ExtendWith(new Category()
            {
                Name          = "Cross Bikes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBks),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerCube, SeedingStrings.ManufacturerGiant, SeedingStrings.ManufacturerGt, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerTrek)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBksHybrid)
                .ExtendWith(new Category()
            {
                Name          = "Hybrid Bikes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBks),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerCube, SeedingStrings.ManufacturerGiant, SeedingStrings.ManufacturerGt, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerTrek)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBksMountain)
                .ExtendWith(new Category()
            {
                Name          = "Mountain Bikes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBks),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerCube, SeedingStrings.ManufacturerGiant, SeedingStrings.ManufacturerGt, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerTrek)
            }).TimeStampNew());


            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBksRoad)
                .ExtendWith(new Category()
            {
                Name          = "Road Bikes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBks),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerGiant, SeedingStrings.ManufacturerGt, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerTrek)
            }).TimeStampNew());
        }
コード例 #3
0
 private void SeedMainUser(ISeedContext seedContext)
 {
     seedContext.Add(seedContext.BuildWrappedObject <User>(SeedingStrings.SystemUser).ExtendWith(new User()
     {
         Username = "******",
         Password = "******"
     }).TimeStampNew().SetSystemFlag().SetClientFlag().TimeStampTenant(seedContext.Tenant()));
 }
コード例 #4
0
ファイル: 05_ProductSeeder.cs プロジェクト: emir01/Web-Shop
        private void AddEquipmentProducts(ISeedContext seedContext, Tenant tenant)
        {
            var bikingEquipment = GetBikingEquipment(seedContext);

            foreach (var product in bikingEquipment)
            {
                seedContext.Add(product.TimeStampNew().TimeStampTenant(tenant).Alias(product.Name));
            }
        }
コード例 #5
0
ファイル: 05_ProductSeeder.cs プロジェクト: emir01/Web-Shop
        public void AddBikes(ISeedContext seedContext, Tenant tenant)
        {
            var bikeList = GetBikeList(seedContext);

            foreach (var product in bikeList)
            {
                seedContext.Add(product.TimeStampNew().TimeStampTenant(tenant).Alias(product.Name));
            }
        }
コード例 #6
0
ファイル: 05_ProductSeeder.cs プロジェクト: emir01/Web-Shop
        private void AddClothingProducts(ISeedContext seedContext, Tenant tenant)
        {
            var bikingClothes = GetClothingList(seedContext);

            foreach (var product in bikingClothes)
            {
                seedContext.Add(product.TimeStampNew().TimeStampTenant(tenant).Alias(product.Name));
            }
        }
コード例 #7
0
        private void SeedBusinessDomains(ISeedContext seedContext)
        {
            seedContext.Add(seedContext.BuildWrappedObject <BusinessDomain>(SeedingStrings.BusinessDomainBikeStore).ExtendWith(new BusinessDomain()
            {
                Name = "Bike Store"
            }).TimeStampNew().SetSystemFlag());

            seedContext.Add(seedContext.BuildWrappedObject <BusinessDomain>(SeedingStrings.BusinessDomainBikeEquipmentStore).ExtendWith(new BusinessDomain()
            {
                Name = "Bike Equipment Store"
            }).TimeStampNew().SetSystemFlag());

            seedContext.Add(seedContext.BuildWrappedObject <BusinessDomain>(SeedingStrings.BusinessDomainBikeClothingStore).ExtendWith(new BusinessDomain()
            {
                Name = "Bike Clothing Store"
            }).TimeStampNew().SetSystemFlag());

            // link business domains with entity
        }
コード例 #8
0
 private static void AddMainProductCategoryForAllTenants(ISeedContext seedContext)
 {
     // add the system defined main product category
     seedContext.Add(
         seedContext.BuildWrappedObject <Category>(SeedingStrings.CAT_Product)
         .ExtendWith(new Category()
     {
         Name   = "Product",
         Parent = null,
     }).TimeStampNew().SetSystemFlag());
 }
コード例 #9
0
        private void SeedMainTenant(ISeedContext seedContext)
        {
            seedContext.Add(seedContext.BuildWrappedObject <Tenant>(SeedingStrings.SystemTenantAlias).ExtendWith(new Tenant
            {
                Name = "WebShop",

                BusinessDomains = seedContext.GetObjectsForAlias <BusinessDomain>(SeedingStrings.BusinessDomainBikeClothingStore,
                                                                                  SeedingStrings.BusinessDomainBikeEquipmentStore,
                                                                                  SeedingStrings.BusinessDomainBikeStore)
            }).TimeStampNew().SetSystemFlag().SetClientFlag());
        }
コード例 #10
0
        public void AddBikeClothingCategories(ISeedContext seedContext)
        {
            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothing)
                .ExtendWith(new Category()
            {
                Name   = "Bike Clothing",
                Parent = seedContext.GetObjectForAlias <Category>(SeedingStrings.CAT_Product),
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothingBottoms)
                .ExtendWith(new Category()
            {
                Name          = "Biking Bottoms",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeClothing),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerTrek, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerForceCz)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothingTops)
                .ExtendWith(new Category()
            {
                Name          = "Biking Tops",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeClothing),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerTrek, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerForceCz)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothingShoes)
                .ExtendWith(new Category()
            {
                Name          = "Biking Shoes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeClothing),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerBontager, SeedingStrings.ManufacturerShimano)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothingHelmets)
                .ExtendWith(new Category()
            {
                Name          = "Biking Helmets",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeClothing),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerTrek, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerForceCz, SeedingStrings.ManufacturerGiro)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeClothingWindJackets)
                .ExtendWith(new Category()
            {
                Name          = "Biking Wind Jackets",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeClothing),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerTrek, SeedingStrings.ManufacturerSpecialized, SeedingStrings.ManufacturerForceCz, SeedingStrings.ManufacturerGiro)
            }).TimeStampNew());
        }
コード例 #11
0
        public void AddBikeEquipmentCategories
            (ISeedContext seedContext)
        {
            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipment)
                .ExtendWith(new Category()
            {
                Name   = "Bike Equipment",
                Parent = seedContext.GetObjectForAlias <Category>(SeedingStrings.CAT_Product),
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentBackGearset)
                .ExtendWith(new Category()
            {
                Name          = "Back Gearsets",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerSram, SeedingStrings.ManufacturerShimano)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentFrontGearset)
                .ExtendWith(new Category()
            {
                Name          = "Front Gearsets",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerSram, SeedingStrings.ManufacturerShimano)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentForks)
                .ExtendWith(new Category()
            {
                Name          = "Forks",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerFox, SeedingStrings.ManufacturerRockShox, SeedingStrings.ManufacturerSuntour)
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentInnerTubes)
                .ExtendWith(new Category()
            {
                Name          = "Inner Tubes",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerMichelin, SeedingStrings.ManufacturerContinental, SeedingStrings.ManufacturerBontager),
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentTires)
                .ExtendWith(new Category()
            {
                Name          = "Tires",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerMichelin, SeedingStrings.ManufacturerContinental, SeedingStrings.ManufacturerBontager),
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Category>(SeedingStrings.CategoryBikeEquipmentWheels)
                .ExtendWith(new Category()
            {
                Name          = "Wheels",
                Parent        = seedContext.GetObjectForAlias <Category>(SeedingStrings.CategoryBikeEquipment),
                Manufacturers = seedContext.GetObjectsForAlias <Manufacturer>(SeedingStrings.ManufacturerShimano, SeedingStrings.ManufacturerBontager),
            }).TimeStampNew());
        }
コード例 #12
0
        public void SeedData(ISeedContext seedContext)
        {
            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerBontager)
                .ExtendWith(new Manufacturer()
            {
                Name = "Bontager",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerCube)
                .ExtendWith(new Manufacturer()
            {
                Name = "Cube",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerForceCz)
                .ExtendWith(new Manufacturer()
            {
                Name = "Force Cz",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerBiemme)
                .ExtendWith(new Manufacturer()
            {
                Name = "Biemme"
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerGiant)
                .ExtendWith(new Manufacturer()
            {
                Name = "Giant",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerGt)
                .ExtendWith(new Manufacturer()
            {
                Name = "GT",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerSpecialized)
                .ExtendWith(new Manufacturer()
            {
                Name = "Specialized",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerTrek)
                .ExtendWith(new Manufacturer()
            {
                Name = "Trek",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerShimano)
                .ExtendWith(new Manufacturer()
            {
                Name = "Shimano",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerSram)
                .ExtendWith(new Manufacturer()
            {
                Name = "Sram",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerSuntour)
                .ExtendWith(new Manufacturer()
            {
                Name = "Suntour",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerRockShox)
                .ExtendWith(new Manufacturer()
            {
                Name = "Rock Shox",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerFox)
                .ExtendWith(new Manufacturer()
            {
                Name = "Foxs",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerRockShox)
                .ExtendWith(new Manufacturer()
            {
                Name = "Fox",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerMichelin)
                .ExtendWith(new Manufacturer()
            {
                Name = "Michelin",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerContinental)
                .ExtendWith(new Manufacturer()
            {
                Name = "Continental",
            }).TimeStampNew());

            seedContext.Add(
                seedContext.BuildWrappedObject <Manufacturer>(SeedingStrings.ManufacturerGiro)
                .ExtendWith(new Manufacturer()
            {
                Name = "Giro",
            }).TimeStampNew());
        }