Skip to content

Commit

Permalink
refactor: clean up dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal authored and ArneD committed May 24, 2024
1 parent 602e395 commit a72db62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 26 deletions.
14 changes: 5 additions & 9 deletions src/BuildingRegistry.Api.Legacy/Building/BuildingController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace BuildingRegistry.Api.Legacy.Building
using Microsoft.Extensions.Options;
using Microsoft.SyndicationFeed;
using Microsoft.SyndicationFeed.Atom;
using Projections.Legacy;
using Query;
using Swashbuckle.AspNetCore.Filters;
using Sync;
Expand Down Expand Up @@ -82,8 +81,6 @@ await _mediator.Send(
/// <summary>
/// Vraag een lijst met actieve gebouwn op.
/// </summary>
/// <param name="context"></param>
/// <param name="responseOptions"></param>
/// <param name="cancellationToken"></param>
/// <response code="200">Als de opvraging van een lijst met gebouwn gelukt is.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
Expand All @@ -94,8 +91,6 @@ await _mediator.Send(
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(BuildingListResponseExamples))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> List(
[FromServices] LegacyContext context,
[FromServices] IOptions<ResponseOptions> responseOptions,
CancellationToken cancellationToken = default)
{
var listResponse = await _mediator.Send(
Expand All @@ -122,7 +117,8 @@ public async Task<IActionResult> List(
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(TotalCountResponseExample))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> Count(CancellationToken cancellationToken = default)
public async Task<IActionResult> Count(
CancellationToken cancellationToken = default)
{
var response = await _mediator.Send(new CountRequest(
Request.ExtractFilteringRequest<BuildingFilter>(),
Expand Down Expand Up @@ -191,7 +187,7 @@ private static async Task<string> BuildAtomFeed(
: (long?) null;

var nextUri = BuildNextSyncUri(pagedBuildings.PaginationInfo.Limit, nextFrom,
syndicationConfiguration["NextUri"]);
syndicationConfiguration["NextUri"]!);
if (nextUri is not null)
{
await writer.Write(new SyndicationLink(nextUri, "next"));
Expand All @@ -202,8 +198,8 @@ private static async Task<string> BuildAtomFeed(
await writer.WriteBuilding(
responseOptions,
formatter,
syndicationConfiguration["Category1"],
syndicationConfiguration["Category2"],
syndicationConfiguration["Category1"]!,
syndicationConfiguration["Category2"]!,
building);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ namespace BuildingRegistry.Api.Oslo.Building
using Count;
using Detail;
using Infrastructure;
using Infrastructure.Options;
using List;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Projections.Legacy;
using Query;
using Swashbuckle.AspNetCore.Filters;
using ProblemDetails = Be.Vlaanderen.Basisregisters.BasicApiProblem.ProblemDetails;
Expand Down Expand Up @@ -72,8 +69,6 @@ await _mediator.Send(
/// <summary>
/// Vraag een lijst met actieve gebouwn op.
/// </summary>
/// <param name="context"></param>
/// <param name="responseOptions"></param>
/// <param name="cancellationToken"></param>
/// <response code="200">Als de opvraging van een lijst met gebouwn gelukt is.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
Expand All @@ -85,8 +80,6 @@ await _mediator.Send(
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(BuildingListResponseOsloExamples))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> List(
[FromServices] LegacyContext context,
[FromServices] IOptions<ResponseOptions> responseOptions,
CancellationToken cancellationToken = default)
{
var listResponse = await _mediator.Send(
Expand All @@ -105,7 +98,6 @@ public async Task<IActionResult> List(
/// <summary>
/// Vraag het totaal aantal actieve gebouwen op.
/// </summary>
/// <param name="context"></param>
/// <param name="cancellationToken"></param>
/// <response code="200">Als de opvraging van het totaal aantal gelukt is.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
Expand All @@ -116,7 +108,6 @@ public async Task<IActionResult> List(
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(TotalCountOsloResponseExample))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> Count(
[FromServices] LegacyContext context,
CancellationToken cancellationToken = default)
{
var response = await _mediator.Send(new BuildingCountRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ namespace BuildingRegistry.Api.Oslo.BuildingUnit
using Count;
using Detail;
using Infrastructure;
using Infrastructure.Options;
using List;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Projections.Legacy;
using Query;
using Swashbuckle.AspNetCore.Filters;

Expand All @@ -39,8 +36,6 @@ public BuildingUnitOsloController(IMediator mediator)
/// <summary>
/// Vraag een lijst met actieve gebouweenheden op.
/// </summary>
/// <param name="context"></param>
/// <param name="responseOptions"></param>
/// <param name="cancellationToken"></param>
/// <response code="200">Als de opvraging van een lijst met gebouweenheden gelukt is.</response>
/// <response code="500">Als er een interne fout is opgetreden.</response>
Expand All @@ -52,8 +47,6 @@ public BuildingUnitOsloController(IMediator mediator)
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(BuildingUnitListOsloResponseExamples))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> List(
[FromServices] LegacyContext context,
[FromServices] IOptions<ResponseOptions> responseOptions,
CancellationToken cancellationToken = default)
{
var filtering = Request.ExtractFilteringRequest<BuildingUnitFilter>();
Expand All @@ -80,7 +73,8 @@ public async Task<IActionResult> List(
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
[SwaggerResponseExample(StatusCodes.Status200OK, typeof(TotalCountOsloResponseExample))]
[SwaggerResponseExample(StatusCodes.Status500InternalServerError, typeof(InternalServerErrorResponseExamples))]
public async Task<IActionResult> Count(CancellationToken cancellationToken = default)
public async Task<IActionResult> Count(
CancellationToken cancellationToken = default)
{
var filtering = Request.ExtractFilteringRequest<BuildingUnitFilter>();
var sorting = Request.ExtractSortingRequest();
Expand Down

0 comments on commit a72db62

Please sign in to comment.