Browse Source

Update to latest Endpoints package and fix breaking changes (#506)

main
Steve Smith 5 years ago
committed by GitHub
parent
commit
ba9aea29bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/BlazorShared/BlazorShared.csproj
  2. 4
      src/PublicApi/AuthEndpoints/Authenticate.cs
  3. 4
      src/PublicApi/CatalogBrandEndpoints/List.cs
  4. 4
      src/PublicApi/CatalogItemEndpoints/Create.cs
  5. 4
      src/PublicApi/CatalogItemEndpoints/Delete.cs
  6. 4
      src/PublicApi/CatalogItemEndpoints/GetById.cs
  7. 4
      src/PublicApi/CatalogItemEndpoints/ListPaged.cs
  8. 4
      src/PublicApi/CatalogItemEndpoints/Update.cs
  9. 4
      src/PublicApi/CatalogTypeEndpoints/List.cs
  10. 2
      src/PublicApi/PublicApi.csproj

1
src/BlazorShared/BlazorShared.csproj

@ -8,6 +8,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="BlazorInputFile" Version="0.2.0" /> <PackageReference Include="BlazorInputFile" Version="0.2.0" />
<PackageReference Include="FluentValidation" Version="9.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

4
src/PublicApi/AuthEndpoints/Authenticate.cs

@ -9,7 +9,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints
{ {
public class Authenticate : BaseAsyncEndpoint<AuthenticateRequest, AuthenticateResponse> public class Authenticate : BaseAsyncEndpoint
.WithRequest<AuthenticateRequest>
.WithResponse<AuthenticateResponse>
{ {
private readonly SignInManager<ApplicationUser> _signInManager; private readonly SignInManager<ApplicationUser> _signInManager;
private readonly ITokenClaimsService _tokenClaimsService; private readonly ITokenClaimsService _tokenClaimsService;

4
src/PublicApi/CatalogBrandEndpoints/List.cs

@ -10,7 +10,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints
{ {
public class List : BaseAsyncEndpoint<ListCatalogBrandsResponse> public class List : BaseAsyncEndpoint
.WithoutRequest
.WithResponse<ListCatalogBrandsResponse>
{ {
private readonly IAsyncRepository<CatalogBrand> _catalogBrandRepository; private readonly IAsyncRepository<CatalogBrand> _catalogBrandRepository;
private readonly IMapper _mapper; private readonly IMapper _mapper;

4
src/PublicApi/CatalogItemEndpoints/Create.cs

@ -13,7 +13,9 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
{ {
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class Create : BaseAsyncEndpoint<CreateCatalogItemRequest, CreateCatalogItemResponse> public class Create : BaseAsyncEndpoint
.WithRequest<CreateCatalogItemRequest>
.WithResponse<CreateCatalogItemResponse>
{ {
private readonly IAsyncRepository<CatalogItem> _itemRepository; private readonly IAsyncRepository<CatalogItem> _itemRepository;
private readonly IUriComposer _uriComposer; private readonly IUriComposer _uriComposer;

4
src/PublicApi/CatalogItemEndpoints/Delete.cs

@ -11,7 +11,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
{ {
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class Delete : BaseAsyncEndpoint<DeleteCatalogItemRequest, DeleteCatalogItemResponse> public class Delete : BaseAsyncEndpoint
.WithRequest<DeleteCatalogItemRequest>
.WithResponse<DeleteCatalogItemResponse>
{ {
private readonly IAsyncRepository<CatalogItem> _itemRepository; private readonly IAsyncRepository<CatalogItem> _itemRepository;

4
src/PublicApi/CatalogItemEndpoints/GetById.cs

@ -8,7 +8,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
{ {
public class GetById : BaseAsyncEndpoint<GetByIdCatalogItemRequest, GetByIdCatalogItemResponse> public class GetById : BaseAsyncEndpoint
.WithRequest<GetByIdCatalogItemRequest>
.WithResponse<GetByIdCatalogItemResponse>
{ {
private readonly IAsyncRepository<CatalogItem> _itemRepository; private readonly IAsyncRepository<CatalogItem> _itemRepository;
private readonly IUriComposer _uriComposer; private readonly IUriComposer _uriComposer;

4
src/PublicApi/CatalogItemEndpoints/ListPaged.cs

@ -12,7 +12,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
{ {
public class ListPaged : BaseAsyncEndpoint<ListPagedCatalogItemRequest, ListPagedCatalogItemResponse> public class ListPaged : BaseAsyncEndpoint
.WithRequest<ListPagedCatalogItemRequest>
.WithResponse<ListPagedCatalogItemResponse>
{ {
private readonly IAsyncRepository<CatalogItem> _itemRepository; private readonly IAsyncRepository<CatalogItem> _itemRepository;
private readonly IUriComposer _uriComposer; private readonly IUriComposer _uriComposer;

4
src/PublicApi/CatalogItemEndpoints/Update.cs

@ -12,7 +12,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints
{ {
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] [Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class Update : BaseAsyncEndpoint<UpdateCatalogItemRequest, UpdateCatalogItemResponse> public class Update : BaseAsyncEndpoint
.WithRequest<UpdateCatalogItemRequest>
.WithResponse<UpdateCatalogItemResponse>
{ {
private readonly IAsyncRepository<CatalogItem> _itemRepository; private readonly IAsyncRepository<CatalogItem> _itemRepository;
private readonly IUriComposer _uriComposer; private readonly IUriComposer _uriComposer;

4
src/PublicApi/CatalogTypeEndpoints/List.cs

@ -10,7 +10,9 @@ using System.Threading.Tasks;
namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints
{ {
public class List : BaseAsyncEndpoint<ListCatalogTypesResponse> public class List : BaseAsyncEndpoint
.WithoutRequest
.WithResponse<ListCatalogTypesResponse>
{ {
private readonly IAsyncRepository<CatalogType> _catalogTypeRepository; private readonly IAsyncRepository<CatalogType> _catalogTypeRepository;
private readonly IMapper _mapper; private readonly IMapper _mapper;

2
src/PublicApi/PublicApi.csproj

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Ardalis.ApiEndpoints" Version="2.0.0" /> <PackageReference Include="Ardalis.ApiEndpoints" Version="3.0.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" /> <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" />
<PackageReference Include="MediatR" Version="9.0.0" /> <PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> <PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />

Loading…
Cancel
Save