Skip to content
Permalink
Browse files

updated to ASP.NET Core 2.2

  • Loading branch information...
jwatmore
jwatmore committed Jan 14, 2019
1 parent bed2f25 commit ca520ff162270d71192f1226a06bd875aeeade2f
Showing with 14 additions and 23 deletions.
  1. +1 −1 .vscode/launch.json
  2. +4 −4 .vscode/tasks.json
  3. +1 −1 README.md
  4. +5 −12 Startup.cs
  5. +3 −3 WebApi.csproj
  6. +0 −1 appsettings.Development.json
  7. +0 −1 appsettings.json
@@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.1/WebApi.dll",
"program": "${workspaceRoot}/bin/Debug/netcoreapp2.2/WebApi.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
@@ -1,15 +1,15 @@
{
"version": "0.1.0",
"version": "2.0.0",
"command": "dotnet",
"isShellCommand": true,
"type": "shell",
"args": [],
"tasks": [
{
"taskName": "build",
"label": "build",
"args": [
"${workspaceRoot}/WebApi.csproj"
],
"isBuildCommand": true,
"group": "build",
"problemMatcher": "$msCompile"
}
]
@@ -1,5 +1,5 @@
# aspnet-core-registration-login-api

ASP.NET Core 2.1 - API for User Management, Authentication and Registration
ASP.NET Core 2.2 - API for User Management, Authentication and Registration

For documentation and instructions check out http://jasonwatmore.com/post/2018/06/26/aspnet-core-21-simple-api-for-authentication-registration-and-user-management
@@ -1,19 +1,16 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using WebApi.Helpers;
using WebApi.Services;
using AutoMapper;
using Microsoft.IdentityModel.Tokens;
using System.Text;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Mvc;

namespace WebApi
{
@@ -31,7 +28,7 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddCors();
services.AddDbContext<DataContext>(x => x.UseInMemoryDatabase("TestDb"));
services.AddMvc();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);;
services.AddAutoMapper();

// configure strongly typed settings objects
@@ -79,17 +76,13 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

// global cors policy
app.UseCors(x => x
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
.AllowAnyHeader());

app.UseAuthentication();

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.0.2" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="2.0.1" />
<PackageReference Include="AutoMapper" Version="8.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
@@ -1,6 +1,5 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
@@ -3,7 +3,6 @@
"Secret": "THIS IS USED TO SIGN AND VERIFY JWT TOKENS, REPLACE IT WITH YOUR OWN SECRET, IT CAN BE ANY STRING"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}

0 comments on commit ca520ff

Please sign in to comment.
You can’t perform that action at this time.