From f67b20d6bb49a900493fa09083fcda4ed02787e3 Mon Sep 17 00:00:00 2001 From: Michele Date: Sun, 22 Nov 2020 21:58:28 +0000 Subject: [PATCH] trying to fix release build --- .../DataContextModelSnapshot.cs | 84 +++++++++---------- Sledgemapper.Api/Startup.cs | 6 +- Sledgemapper.Api/appsettings.Production.json | 12 +++ 3 files changed, 57 insertions(+), 45 deletions(-) create mode 100644 Sledgemapper.Api/appsettings.Production.json diff --git a/Sledgemapper.Api/Migrations/SqlServerMigrations/DataContextModelSnapshot.cs b/Sledgemapper.Api/Migrations/SqlServerMigrations/DataContextModelSnapshot.cs index d8b492d..d481d75 100644 --- a/Sledgemapper.Api/Migrations/SqlServerMigrations/DataContextModelSnapshot.cs +++ b/Sledgemapper.Api/Migrations/SqlServerMigrations/DataContextModelSnapshot.cs @@ -1,51 +1,51 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Sledgemapper.Helpers; +// // +// using System; +// using Microsoft.EntityFrameworkCore; +// using Microsoft.EntityFrameworkCore.Infrastructure; +// using Microsoft.EntityFrameworkCore.Metadata; +// using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +// using Sledgemapper.Helpers; -namespace Sledgemapper.Migrations.SqlServerMigrations -{ - [DbContext(typeof(DataContext))] - partial class DataContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); +// namespace Sledgemapper.Migrations.SqlServerMigrations +// { +// [DbContext(typeof(DataContext))] +// partial class DataContextModelSnapshot : ModelSnapshot +// { +// protected override void BuildModel(ModelBuilder modelBuilder) +// { +// #pragma warning disable 612, 618 +// modelBuilder +// .HasAnnotation("ProductVersion", "3.1.0") +// .HasAnnotation("Relational:MaxIdentifierLength", 128) +// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("Sledgemapper.Entities.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); +// modelBuilder.Entity("Sledgemapper.Entities.User", b => +// { +// b.Property("Id") +// .ValueGeneratedOnAdd() +// .HasColumnType("int") +// .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); +// b.Property("FirstName") +// .HasColumnType("nvarchar(max)"); - b.Property("LastName") - .HasColumnType("nvarchar(max)"); +// b.Property("LastName") +// .HasColumnType("nvarchar(max)"); - b.Property("PasswordHash") - .HasColumnType("varbinary(max)"); +// b.Property("PasswordHash") +// .HasColumnType("varbinary(max)"); - b.Property("PasswordSalt") - .HasColumnType("varbinary(max)"); +// b.Property("PasswordSalt") +// .HasColumnType("varbinary(max)"); - b.Property("Username") - .HasColumnType("nvarchar(max)"); +// b.Property("Username") +// .HasColumnType("nvarchar(max)"); - b.HasKey("Id"); +// b.HasKey("Id"); - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} +// b.ToTable("Users"); +// }); +// #pragma warning restore 612, 618 +// } +// } +// } diff --git a/Sledgemapper.Api/Startup.cs b/Sledgemapper.Api/Startup.cs index 66d066b..c39fc58 100644 --- a/Sledgemapper.Api/Startup.cs +++ b/Sledgemapper.Api/Startup.cs @@ -35,9 +35,9 @@ namespace Sledgemapper.Api // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - if (_env.IsProduction()) - services.AddDbContext(); - else + // if (_env.IsProduction()) + // services.AddDbContext(); + // else services.AddDbContext(); // services.AddRazorPages(); diff --git a/Sledgemapper.Api/appsettings.Production.json b/Sledgemapper.Api/appsettings.Production.json new file mode 100644 index 0000000..0b5ef19 --- /dev/null +++ b/Sledgemapper.Api/appsettings.Production.json @@ -0,0 +1,12 @@ +{ + "ConnectionStrings": { + "WebApiDatabase": "Data Source=LocalDatabase.db" + }, + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +}