public static void ChangeDatabaseTo(this ITheGarageData db, string newDatabaseName)
        {
            var conStr    = db.Context.Database.Connection.ConnectionString;
            var pattern   = "Initial Catalog *= *([^;]*) *";
            var newConStr = Regex.Replace(conStr, pattern, m =>
            {
                return(m.Groups.Count == 2
                    ? string.Format("Initial Catalog={0}", newDatabaseName)
                    : m.ToString());
            });

            db.Context.Database.Connection.ConnectionString = newConStr;
        }
 public ClientsAdministrationService(ITheGarageData data)
     : base(data)
 {
 }
Exemple #3
0
 public BaseAdministrationService(ITheGarageData data)
 {
     this.data = data;
 }
Exemple #4
0
 public UsersService(ITheGarageData data)
 {
     this.data = data;
 }
Exemple #5
0
 public CompanyAdministrationService(ITheGarageData data)
     : base(data)
 {
 }
Exemple #6
0
 public UsersAdministrationService(ITheGarageData data)
     : base(data)
 {
 }
 public AccountController(ITheGarageData data)
 {
     this.data = data;
 }
 public HomeController(ITheGarageData data)
 {
     this.data = data;
 }
 public UserProfileService(ITheGarageData data)
 {
     this.data = data;
 }