示例#1
0
        public static void Seed(BlogServiceContext context)
        {
            var systemRole = context.Roles.First(x => x.Name == Roles.SYSTEM);
            var roles      = new List <Role>();
            var tenant     = context.Tenants.Single(x => x.Name == "Default");

            var mddTenant = context.Tenants.Single(x => x.Name == "Metrics Driven Development");

            roles.Add(systemRole);

            context.Users.AddOrUpdate(x => x.Username, new User()
            {
                Username = "******",
                Password = new EncryptionService().TransformPassword("system"),
                Roles    = roles,
                TenantId = tenant.Id
            });

            context.Users.AddOrUpdate(x => x.Username, new User()
            {
                Username = "******",
                Password = new EncryptionService().TransformPassword("system"),
                Roles    = roles,
                TenantId = mddTenant.Id
            });

            context.SaveChanges();
        }
示例#2
0
 public AzureBlobStorageDigitalAssetHandler(BlogServiceContext context, ICache cache, Lazy <IAzureBlobStorageConfiguration> lazyConfiguration)
 {
     _context        = context;
     _cache          = cache;
     _configuration  = lazyConfiguration.Value;
     _storageAccount = new CloudStorageAccount(new StorageCredentials(_configuration.AccountName, _configuration.KeyValue), true);
 }
        public static void Seed(BlogServiceContext context)
        {
            context.Tenants.AddOrUpdate(x => x.Name, new Tenant()
            {
                Name     = "Default",
                UniqueId = new Guid("50848e1d-f3ec-486a-b25c-7f6cf1ef7c93")
            });

            context.Tenants.AddOrUpdate(x => x.Name, new Tenant()
            {
                Name     = "Architecture Notes",
                UniqueId = new Guid("4204672e-f64a-4edb-8e5c-01c79b7bcb70")
            });

            context.SaveChanges();
        }
        public static void Seed(BlogServiceContext context)
        {
            context.Roles.AddOrUpdate(x => x.Name, new Role()
            {
                Name = Roles.SYSTEM
            });

            context.Roles.AddOrUpdate(x => x.Name, new Role()
            {
                Name = Roles.ACCOUNT_HOLDER
            });

            context.Roles.AddOrUpdate(x => x.Name, new Role()
            {
                Name = Roles.DEVELOPMENT
            });

            context.SaveChanges();
        }
 public AddOrUpdateProfileHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#6
0
 public AddOrUpdateAccountHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#7
0
 public RemoveTagHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
 public AddOrUpdateCategoryHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
 public GetCategoryByIdHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#10
0
 public GetContributorsHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
 public GetLatestArticlesPageHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#12
0
 public GetDigitalAssetByUniqueIdHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#13
0
 public BlogsRepository(BlogServiceContext context)
 {
     _context = context;
 }
 public GetArticleBySlugHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#15
0
 public SendRegistrationConfirmationHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#16
0
 public GetAccountsHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#17
0
 public UploadDigitalAssetFromBase64StringHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }
示例#18
0
 public GetProfilesHandler(BlogServiceContext context, ICache cache)
 {
     _context = context;
     _cache   = cache;
 }