Skip to content

Commit d7110d9

Browse files
committed
New sample project for dot net core 3.1 added.
1 parent a0d4867 commit d7110d9

File tree

19 files changed

+225
-37
lines changed

19 files changed

+225
-37
lines changed

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ Also add an implementation of *IBasicUserValidationService* as shown below in [*
3232
using AspNetCore.Authentication.Basic;
3333
public class Startup
3434
{
35-
public Startup(IConfiguration configuration)
36-
{
37-
Configuration = configuration;
38-
}
39-
40-
public IConfiguration Configuration { get; }
41-
4235
public void ConfigureServices(IServiceCollection services)
4336
{
4437
// Add the Basic scheme authentication here..
@@ -81,13 +74,6 @@ public class Startup
8174
using AspNetCore.Authentication.Basic;
8275
public class Startup
8376
{
84-
public Startup(IConfiguration configuration)
85-
{
86-
Configuration = configuration;
87-
}
88-
89-
public IConfiguration Configuration { get; }
90-
9177
public void ConfigureServices(IServiceCollection services)
9278
{
9379
// Add the Basic scheme authentication here..

samples/SampleWebApi/Controllers/ValuesController.cs renamed to samples/SampleWebApi_2_0/Controllers/ValuesController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using Microsoft.AspNetCore.Mvc;
22
using System.Collections.Generic;
33

4-
namespace SampleWebApi.Controllers
4+
namespace SampleWebApi_2_2.Controllers
55
{
6-
[Route("api/[controller]")]
7-
public class ValuesController : Controller
6+
[Route("api/[controller]")]
7+
public class ValuesController : ControllerBase
88
{
99
// GET api/values
1010
[HttpGet]
@@ -22,13 +22,13 @@ public string Get(int id)
2222

2323
// POST api/values
2424
[HttpPost]
25-
public void Post([FromBody]string value)
25+
public void Post([FromBody] string value)
2626
{
2727
}
2828

2929
// PUT api/values/5
3030
[HttpPut("{id}")]
31-
public void Put(int id, [FromBody]string value)
31+
public void Put(int id, [FromBody] string value)
3232
{
3333
}
3434

File renamed without changes.

samples/SampleWebApi/SampleWebApi.csproj renamed to samples/SampleWebApi_2_0/SampleWebApi_2_0.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<Folder Include="wwwroot\" />
8+
<Compile Remove="wwwroot\**" />
9+
<Content Remove="wwwroot\**" />
10+
<EmbeddedResource Remove="wwwroot\**" />
11+
<None Remove="wwwroot\**" />
912
</ItemGroup>
1013

1114
<ItemGroup>
12-
<PackageReference Include="AspNetCore.Authentication.Basic" Version="2.2.0" />
15+
<PackageReference Include="AspNetCore.Authentication.Basic" Version="3.1.5-preview.1" />
1316
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
1417
</ItemGroup>
1518

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void ConfigureServices(IServiceCollection services)
4141
// Alternatively, add [Authorize] attribute to Controller or Action Method where necessary.
4242
options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));
4343
}
44-
).AddXmlSerializerFormatters(); // To enable XML along with JSON
44+
); //.AddXmlSerializerFormatters(); // To enable XML along with JSON
4545
}
4646

4747
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
File renamed without changes.

samples/SampleWebApi_2_2/SampleWebApi_2_2.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AspNetCore.Authentication.Basic" Version="2.2.0" />
9+
<PackageReference Include="AspNetCore.Authentication.Basic" Version="3.1.5-preview.1" />
1010
<PackageReference Include="Microsoft.AspNetCore.App" />
1111
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
1212
</ItemGroup>

samples/SampleWebApi_2_2/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void ConfigureServices(IServiceCollection services)
4141
// Alternatively, add [Authorize] attribute to Controller or Action Method where necessary.
4242
options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));
4343
})
44-
.AddXmlSerializerFormatters() // To enable XML along with JSON
44+
//.AddXmlSerializerFormatters() // To enable XML along with JSON
4545
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
4646
}
4747

0 commit comments

Comments
 (0)