Example #1
0
        public void Initialize(DataContext context)
        {
            var uofw = new SystemUnitOfWork(context);

            var repo = uofw.GetRepository <SpecialPermission>();

            if (repo.All().Any())
            {
                return;
            }
            repo.Create(new SpecialPermission()
            {
                Title = "Set permissions"
            });
            uofw.SaveChanges();
        }
        public void Initialize(DataContext context)
        {
            var store   = new RoleStore <Role>(context);
            var manager = new RoleManager <Role>(store);
            var uofw    = new SystemUnitOfWork(context);

            var repo = uofw.GetRepository <AccessLevel>();

            if (repo.All().Any())
            {
                return;
            }
            InitBuyer(repo, manager);
            InitEditor(repo, manager);
            uofw.SaveChanges();
        }