From e6536f667e1b4a0adf779fb1aa5cf4e88be8d4fc Mon Sep 17 00:00:00 2001 From: snehashankar Date: Wed, 24 Jul 2019 16:44:48 -0700 Subject: [PATCH] Merging --- WlihaHackEviction/Models/Model.cs | 2 +- WlihaHackEviction/Startup.cs | 8 +++++++- WlihaHackEviction/appsettings.json | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/WlihaHackEviction/Models/Model.cs b/WlihaHackEviction/Models/Model.cs index 3b714d2..6e25ff3 100644 --- a/WlihaHackEviction/Models/Model.cs +++ b/WlihaHackEviction/Models/Model.cs @@ -156,4 +156,4 @@ public class PermitInfo [DataMember] public string Location1 { get; set; } } -} \ No newline at end of file +} diff --git a/WlihaHackEviction/Startup.cs b/WlihaHackEviction/Startup.cs index bb5193f..af3f1ab 100644 --- a/WlihaHackEviction/Startup.cs +++ b/WlihaHackEviction/Startup.cs @@ -26,6 +26,9 @@ public void ConfigureServices(IServiceCollection services) // Configure the DBContext services.AddDbContext(options => options.UseSqlServer(connectionStringFromConfig)); + //options.UseSqlServer(Configuration.GetConnectionString("SQLConnection"))); + + services.AddCors(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); @@ -52,7 +55,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1")); - + app.UseCors(builder => builder + .SetIsOriginAllowed((origin) => { return true; }) // for now, allow any origin + .AllowAnyMethod() + .AllowAnyHeader()); app.UseHttpsRedirection(); app.UseMvc(routes => { diff --git a/WlihaHackEviction/appsettings.json b/WlihaHackEviction/appsettings.json index 9289f3d..47c61e7 100644 --- a/WlihaHackEviction/appsettings.json +++ b/WlihaHackEviction/appsettings.json @@ -5,7 +5,8 @@ } }, "ConnectionStrings": { - "MySQLConnection": "" + "MySQLConnection": "", + "SQLConnection": "Server=ijfods31344.database.windows.net;Database=wliha;User ID=wliha;Password=***REMOVED***;MultipleActiveResultSets=true" }, "AllowedHosts": "*", "KeyVaultName": "neighborevictions"