Example #1
0
        public void RunSeed(UniformBuilderContext context)
        {
            var users = new List <User>
            {
                new User
                {
                    Id   = IdGenerator.NewId(),
                    Name = "Ashish",
                    Type = UserType.Admin
                },
                new User
                {
                    Id   = IdGenerator.NewId(),
                    Name = "Bob",
                    Type = UserType.Dealer
                },
                new User
                {
                    Id   = IdGenerator.NewId(),
                    Name = "Ann",
                    Type = UserType.Guest
                }
            };

            context.AddOrUpdate <User>(m => m.Id, users);
        }
Example #2
0
        public void RunSeed(UniformBuilderContext context)
        {
            var uniformStyles = new List <UniformStyle>
            {
                new UniformStyle
                {
                    Id             = IdGenerator.NewId(),
                    Name           = "Style1",
                    Description    = "Description for style 1",
                    CreateDate     = DateTime.Now.AddDays(-19),
                    LastUpdateDate = DateTime.Now.AddDays(-5)
                },
                new UniformStyle
                {
                    Id             = IdGenerator.NewId(),
                    Name           = "Style2",
                    Description    = "Description for style 2",
                    CreateDate     = DateTime.Now.AddDays(-19),
                    LastUpdateDate = DateTime.Now.AddDays(-5)
                },
                new UniformStyle
                {
                    Id             = IdGenerator.NewId(),
                    Name           = "Style31",
                    Description    = "Description for style 31",
                    CreateDate     = DateTime.Now.AddDays(-19),
                    LastUpdateDate = DateTime.Now.AddDays(-5)
                },
            };

            context.AddOrUpdate <UniformStyle>(us => us.Id, uniformStyles);
        }
        public void RunSeed(UniformBuilderContext context)
        {
            IList <ApplicationType> applicationTypes = new List <ApplicationType>();

            applicationTypes.Add(new ApplicationType
            {
                Id   = IdGenerator.NewId(),
                Name = "Embroidery"
            });
            applicationTypes.Add(new ApplicationType
            {
                Id   = IdGenerator.NewId(),
                Name = "Tackle Twill"
            });
            applicationTypes.Add(new ApplicationType
            {
                Id   = IdGenerator.NewId(),
                Name = "Sublimated"
            });
            applicationTypes.Add(new ApplicationType
            {
                Id   = IdGenerator.NewId(),
                Name = "Screen Print"
            });

            context.AddOrUpdate(c => c.Id, applicationTypes);
        }
Example #4
0
        public void RunSeed(UniformBuilderContext context)
        {
            IList <Arrangement> arrangements = new List <Arrangement>();

            arrangements.Add(new Arrangement
            {
                Id = IdGenerator.NewId(),
            });
        }
Example #5
0
        protected override void Seed(UniformBuilderContext context)
        {
            var seeds = from t in Assembly.GetExecutingAssembly().GetTypes()
                        where t.GetInterfaces().Contains(typeof(ISeed))
                        select Activator.CreateInstance(t) as ISeed;

            foreach (var seed in seeds)
            {
                seed.RunSeed(context);
            }
            context.Save();
        }
Example #6
0
 public virtual UniformRepository GetUniformRepository(UniformBuilderContext context)
 {
     return(new UniformRepository(context));
 }
Example #7
0
 public virtual UniformBuilderContext GetDataContext()
 {
     return(_context ?? (_context = new UniformBuilderContext()));
 }
Example #8
0
 protected AFeatureManager(UniformBuilderFactory factory)
 {
     Factory     = factory;
     DataContext = Factory.GetDataContext();
 }