Example #1
0
 public RedfernDb() : base("Name=RedfernDbConnection")
 {
     // create a mock context
     this._context                = new RedfernContext();
     this._context.TenantID       = 4;
     this._context.ClientUserName = "******";
 }
Example #2
0
 public RedfernDb(RedfernContext context) : base(RedfernDb.CreateConnectionString(context))
 {
     this._context         = context;
     this._securityContext = new RedfernSecurityContext();
     this.Configuration.LazyLoadingEnabled   = true;
     this.Configuration.ProxyCreationEnabled = true;
 }
Example #3
0
 public static string CreateConnectionString(RedfernContext context)
 {
     return(new SqlConnectionStringBuilder
     {
         DataSource = context.DbServer,
         InitialCatalog = context.DbName,
         UserID = context.DbUser,
         Password = context.DbPassword,
         PersistSecurityInfo = true,
         ApplicationName = "Redfern",
     }.ConnectionString);
 }
Example #4
0
 public RedfernRepository(RedfernContext context)
 {
     _db = new RedfernDb(context);
 }
Example #5
0
 public AppController(RedfernContext context, IUserCache <RedfernUser> cache)
 {
     _userManager = new UserManager <RedfernUser>(new UserStore <RedfernUser>(new RedfernSecurityContext()));
     //cache.Init();
 }