Initial commit

This commit is contained in:
Mark J Price 2022-03-15 11:01:57 +00:00
parent f7cc057037
commit f2066234b0
18 changed files with 98 additions and 18 deletions

View file

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Identity; // IdentityUser
using Microsoft.EntityFrameworkCore; // UseSqlServer, UseSqlite
using Northwind.Mvc.Data; // ApplicationDbContext
using Packt.Shared; // AddNorthwindContext extension method
using System.Net;
using System.Net.Http.Headers; // MediaTypeWithQualityHeaderValue
// Section 2 - configure the host web server including services
@ -40,7 +41,11 @@ builder.Services.AddNorthwindContext();
builder.Services.AddHttpClient(name: "Northwind.WebApi",
configureClient: options =>
{
options.DefaultRequestVersion = HttpVersion.Version30;
options.DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrLower;
options.BaseAddress = new Uri("https://localhost:5002/");
options.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue(
mediaType: "application/json", quality: 1.0));