diff --git a/src/iRLeagueApiCore.Client/Endpoints/PutEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/PutEndpoint.cs new file mode 100644 index 00000000..d568d5c5 --- /dev/null +++ b/src/iRLeagueApiCore.Client/Endpoints/PutEndpoint.cs @@ -0,0 +1,17 @@ +using iRLeagueApiCore.Client.Http; +using iRLeagueApiCore.Client.QueryBuilder; +using iRLeagueApiCore.Client.Results; + +namespace iRLeagueApiCore.Client.Endpoints; + +internal class PutEndpoint : EndpointBase, IPutEndpoint where TModel : notnull +{ + public PutEndpoint(HttpClientWrapper httpClientWrapper, RouteBuilder routeBuilder) : + base(httpClientWrapper, routeBuilder) + { } + + async Task> IPutEndpoint.Put(TModel model, CancellationToken cancellationToken) + { + return await HttpClientWrapper.PutAsClientActionResult(QueryUrl, model, cancellationToken); + } +} diff --git a/src/iRLeagueApiCore.Client/Endpoints/Results/IEventResultsEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/Results/IEventResultsEndpoint.cs index e0bf3143..dec11679 100644 --- a/src/iRLeagueApiCore.Client/Endpoints/Results/IEventResultsEndpoint.cs +++ b/src/iRLeagueApiCore.Client/Endpoints/Results/IEventResultsEndpoint.cs @@ -8,4 +8,5 @@ public interface IEventResultsEndpoint : IGetAllEndpoint, IDel IPostEndpoint Upload(); IPostEndpoint Calculate(); IFetchResultsEndpoint Fetch(); + IGetEndpoint Raw(); } diff --git a/src/iRLeagueApiCore.Client/Endpoints/Results/IRawResultsEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/Results/IRawResultsEndpoint.cs new file mode 100644 index 00000000..a51dca4e --- /dev/null +++ b/src/iRLeagueApiCore.Client/Endpoints/Results/IRawResultsEndpoint.cs @@ -0,0 +1,8 @@ +using iRLeagueApiCore.Common.Models; + +namespace iRLeagueApiCore.Client.Endpoints.Results; +public interface IRawResultsEndpoint +{ + public IGetEndpoint EventResult(long eventId); + public IPutEndpoint ModifyResultRow(long resultRowId, bool triggerCalculation = false); +} diff --git a/src/iRLeagueApiCore.Client/Endpoints/Results/IResultsEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/Results/IResultsEndpoint.cs index d3b30cd3..b99b557e 100644 --- a/src/iRLeagueApiCore.Client/Endpoints/Results/IResultsEndpoint.cs +++ b/src/iRLeagueApiCore.Client/Endpoints/Results/IResultsEndpoint.cs @@ -5,4 +5,5 @@ namespace iRLeagueApiCore.Client.Endpoints.Results; public interface IResultsEndpoint : IWithIdEndpoint { public IGetEndpoint> Latest(); + public IPutEndpoint ModifyResultRow(long resultRowId, bool triggerCalculation = false); } diff --git a/src/iRLeagueApiCore.Client/Endpoints/Results/RawResultsEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/Results/RawResultsEndpoint.cs new file mode 100644 index 00000000..375eddd6 --- /dev/null +++ b/src/iRLeagueApiCore.Client/Endpoints/Results/RawResultsEndpoint.cs @@ -0,0 +1,13 @@ +using iRLeagueApiCore.Client.Http; +using iRLeagueApiCore.Client.QueryBuilder; +using iRLeagueApiCore.Common.Models; + +namespace iRLeagueApiCore.Client.Endpoints.Results; + +internal sealed class RawResultsEndpoint : GetEndpoint +{ + public RawResultsEndpoint(HttpClientWrapper httpClient, RouteBuilder routeBuilder) : base(httpClient, routeBuilder) + { + RouteBuilder.AddEndpoint("Raw"); + } +} diff --git a/src/iRLeagueApiCore.Client/Endpoints/Results/ResultsEndpoint.cs b/src/iRLeagueApiCore.Client/Endpoints/Results/ResultsEndpoint.cs index 284fd81f..5e10ecd7 100644 --- a/src/iRLeagueApiCore.Client/Endpoints/Results/ResultsEndpoint.cs +++ b/src/iRLeagueApiCore.Client/Endpoints/Results/ResultsEndpoint.cs @@ -15,6 +15,20 @@ public ResultsEndpoint(HttpClientWrapper httpClientWrapper, RouteBuilder routeBu RouteBuilder.AddEndpoint("Results"); } + public IGetEndpoint Raw() + { + return new RawResultsEndpoint(HttpClientWrapper, RouteBuilder); + } + + public IPutEndpoint ModifyResultRow(long resultRowId, bool triggerCalculation = false) + { + var routeBuilder = RouteBuilder.Copy(); + routeBuilder.AddEndpoint("ModResultRow"); + routeBuilder.AddParameter(resultRowId); + routeBuilder.WithParameters(x => x.Add("triggerCaculation", triggerCalculation)); + return new PutEndpoint(HttpClientWrapper, routeBuilder); + } + public IPostEndpoint Upload() { return new UploadResultEndpoint(HttpClientWrapper, RouteBuilder); diff --git a/src/iRLeagueApiCore.Client/Service/LeagueClientServiceCollectionExtensions.cs b/src/iRLeagueApiCore.Client/Service/LeagueClientServiceCollectionExtensions.cs index 20ee20c1..ce1e6b56 100644 --- a/src/iRLeagueApiCore.Client/Service/LeagueClientServiceCollectionExtensions.cs +++ b/src/iRLeagueApiCore.Client/Service/LeagueClientServiceCollectionExtensions.cs @@ -3,6 +3,8 @@ using iRLeagueApiCore.Client.Service; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; +using System.Text.Json.Serialization; +using System.Text.Json; namespace Microsoft.Extensions.DependencyInjection; public static class IRLeagueApiClientServiceExtensions @@ -10,10 +12,17 @@ public static class IRLeagueApiClientServiceExtensions public static IServiceCollection AddLeagueApiClient(this IServiceCollection services, Action? configure = null) { services.AddHttpClient(); - services.TryAddScoped(); + + var jsonOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web); + jsonOptions.Converters.Add(new JsonStringEnumConverter()); + jsonOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; + + services.TryAddScoped(sp => new( + sp.GetRequiredService(), + jsonOptions + )); services.TryAddScoped(); services.TryAddScoped(sp => sp.GetRequiredService()); - // run configuration var configuration = new LeagueApiClientConfiguration(services); configure?.Invoke(configuration); diff --git a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj index 9d2dde57..9e142052 100644 --- a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj +++ b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj @@ -12,7 +12,7 @@ Library net6.0 iRLeagueApiCore.Client - 0.11.5-dev.1 + 0.11.5-dev.9 Simon Schulze Simon Schulze This package contains shared objects for all members of the iRLeagueDatabase-iRLeagueApi stack diff --git a/src/iRLeagueApiCore.Common/Models/Results/RawEventResultModel.cs b/src/iRLeagueApiCore.Common/Models/Results/RawEventResultModel.cs new file mode 100644 index 00000000..29a1b002 --- /dev/null +++ b/src/iRLeagueApiCore.Common/Models/Results/RawEventResultModel.cs @@ -0,0 +1,7 @@ +namespace iRLeagueApiCore.Common.Models; + +public sealed class RawEventResultModel +{ + public long EventId { get; set; } + public IEnumerable SessionResults { get; set; } = Array.Empty(); +} diff --git a/src/iRLeagueApiCore.Common/Models/Results/RawResultRowModel.cs b/src/iRLeagueApiCore.Common/Models/Results/RawResultRowModel.cs new file mode 100644 index 00000000..0d90294a --- /dev/null +++ b/src/iRLeagueApiCore.Common/Models/Results/RawResultRowModel.cs @@ -0,0 +1,96 @@ +namespace iRLeagueApiCore.Common.Models; + +[DataContract] +public sealed class RawResultRowModel +{ + [DataMember] + public long ResultRowId { get; set; } + [DataMember] + public long MemberId { get; set; } + [DataMember] + public double StartPosition { get; set; } + [DataMember] + public double FinishPosition { get; set; } + [DataMember] + public string CarNumber { get; set; } = string.Empty; + [DataMember] + public int ClassId { get; set; } + [DataMember] + public string Car { get; set; } = string.Empty; + [DataMember] + public string CarClass { get; set; } = string.Empty; + [DataMember] + public double CompletedLaps { get; set; } + [DataMember] + public double LeadLaps { get; set; } + [DataMember] + public int FastLapNr { get; set; } + [DataMember] + public double Incidents { get; set; } + [DataMember] + public int Status { get; set; } + [DataMember] + public TimeSpan QualifyingTime { get; set; } + [DataMember] + public TimeSpan Interval { get; set; } + [DataMember] + public TimeSpan AvgLapTime { get; set; } + [DataMember] + public TimeSpan FastestLapTime { get; set; } + [DataMember] + public double PositionChange { get; set; } + [DataMember] + public string IRacingId { get; set; } = string.Empty; + [DataMember] + public int SimSessionType { get; set; } + [DataMember] + public int OldIRating { get; set; } + [DataMember] + public int NewIRating { get; set; } + [DataMember] + public int SeasonStartIRating { get; set; } + [DataMember] + public string License { get; set; } = string.Empty; + [DataMember] + public double OldSafetyRating { get; set; } + [DataMember] + public double NewSafetyRating { get; set; } + [DataMember] + public int OldCpi { get; set; } + [DataMember] + public int NewCpi { get; set; } + [DataMember] + public int ClubId { get; set; } + [DataMember] + public string ClubName { get; set; } = string.Empty; + [DataMember] + public int CarId { get; set; } + [DataMember] + public double CompletedPct { get; set; } + [DataMember] + public DateTime? QualifyingTimeAt { get; set; } + [DataMember] + public int Division { get; set; } + [DataMember] + public int OldLicenseLevel { get; set; } + [DataMember] + public int NewLicenseLevel { get; set; } + [DataMember] + public int NumPitStops { get; set; } + [DataMember] + public string PittedLaps { get; set; } = string.Empty; + [DataMember] + public int NumOfftrackLaps { get; set; } + [DataMember] + public string OfftrackLaps { get; set; } = string.Empty; + [DataMember] + public int NumContactLaps { get; set; } + [DataMember] + public string ContactLaps { get; set; } = string.Empty; + [DataMember] + public double RacePoints { get; set; } + [DataMember] + public long? TeamId { get; set; } + [DataMember] + public bool PointsEligible { get; set; } +} diff --git a/src/iRLeagueApiCore.Common/Models/Results/RawSessionResultModel.cs b/src/iRLeagueApiCore.Common/Models/Results/RawSessionResultModel.cs new file mode 100644 index 00000000..6a407001 --- /dev/null +++ b/src/iRLeagueApiCore.Common/Models/Results/RawSessionResultModel.cs @@ -0,0 +1,7 @@ +namespace iRLeagueApiCore.Common.Models; + +public sealed class RawSessionResultModel +{ + public long SessionId { get; set; } + public IEnumerable ResultRows { get; set; } = Array.Empty(); +} diff --git a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj index ab89b7f5..96e757b4 100644 --- a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj +++ b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj @@ -18,7 +18,7 @@ Library net6.0 iRLeagueApiCore.Common - 0.11.5-dev.1 + 0.11.5-dev.8 Simon Schulze Simon Schulze enable diff --git a/src/iRLeagueApiCore.Server/Controllers/ResultsController.cs b/src/iRLeagueApiCore.Server/Controllers/ResultsController.cs index b9e1939a..27cfc979 100644 --- a/src/iRLeagueApiCore.Server/Controllers/ResultsController.cs +++ b/src/iRLeagueApiCore.Server/Controllers/ResultsController.cs @@ -74,7 +74,7 @@ public async Task>> GetFromSeas [HttpGet] [AllowAnonymous] [Route("/{leagueName}/Events/{eventId:long}/[controller]")] - public async Task>> GetFromEvent([FromRoute] string leagueName, [FromRoute] long eventId, + public async Task>> GetFromEvent([FromRoute] string leagueName, [FromRoute] long eventId, CancellationToken cancellationToken = default) { var request = new GetResultsFromEventRequest(eventId); @@ -157,4 +157,25 @@ public async Task> TriggerResultCalculation([FromRoute] strin await mediator.Send(request, cancellationToken); return Ok(true); } + + [HttpGet] + [RequireLeagueRole(LeagueRoles.Admin, LeagueRoles.Organizer)] + [Route("/{leagueName}/Events/{eventId:long}/Results/Raw")] + public async Task> GetRawEventResult([FromRoute] string leagueName, [FromRoute] long eventId, CancellationToken cancellationToken = default) + { + var request = new GetRawResultsFromEventRequest(eventId); + var result = await mediator.Send(request, cancellationToken); + return Ok(result); + } + + [HttpPut] + [RequireLeagueRole(LeagueRoles.Admin, LeagueRoles.Organizer)] + [Route("ModResultRow/{resultRowId:long}")] + public async Task> ModifyResultRow([FromRoute] string leagueName, [FromRoute] long resultRowId, [FromBody] RawResultRowModel model, + [FromQuery] bool triggerCalculation = false, CancellationToken cancellationToken = default) + { + var request = new ModifyResultRowRequest(resultRowId, model, triggerCalculation); + var result = await mediator.Send(request, cancellationToken); + return Ok(result); + } } diff --git a/src/iRLeagueApiCore.Server/Handlers/Results/GetRawResultsFromEventHandler.cs b/src/iRLeagueApiCore.Server/Handlers/Results/GetRawResultsFromEventHandler.cs new file mode 100644 index 00000000..6e7ec587 --- /dev/null +++ b/src/iRLeagueApiCore.Server/Handlers/Results/GetRawResultsFromEventHandler.cs @@ -0,0 +1,82 @@ +using iRLeagueApiCore.Common.Models; +using System.Linq.Expressions; + +namespace iRLeagueApiCore.Server.Handlers.Results; + +public record GetRawResultsFromEventRequest(long EventId) : IRequest; + +public class GetRawResultsFromEventHandler : ResultHandlerBase +{ + public GetRawResultsFromEventHandler(ILogger logger, LeagueDbContext dbContext, + IEnumerable> validators) : base(logger, dbContext, validators) + { + } + + public override async Task Handle(GetRawResultsFromEventRequest request, CancellationToken cancellationToken) + { + await validators.ValidateAllAndThrowAsync(request, cancellationToken); + var result = await dbContext.EventResults + .Where(x => x.EventId == request.EventId) + .Select(MapToRawEventResultModelExpression) + .FirstOrDefaultAsync(cancellationToken) + ?? throw new ResourceNotFoundException(); + return result; + } + + private Expression> MapToRawEventResultModelExpression => result => new() + { + EventId = result.EventId, + SessionResults = result.SessionResults.Select(sessionResult => new RawSessionResultModel() + { + SessionId = sessionResult.SessionId, + ResultRows = sessionResult.ResultRows.Select(row => new RawResultRowModel() + { + ResultRowId = row.ResultRowId, + MemberId = row.MemberId, + StartPosition = row.StartPosition, + FinishPosition = row.FinishPosition, + CarNumber = row.CarNumber, + ClassId = row.ClassId, + Car = row.Car, + CarClass = row.CarClass, + CompletedLaps = row.CompletedLaps, + LeadLaps = row.LeadLaps, + FastLapNr = row.FastLapNr, + Incidents = row.Incidents, + Status = row.Status, + QualifyingTime = row.QualifyingTime, + Interval = row.Interval, + AvgLapTime = row.AvgLapTime, + FastestLapTime = row.FastestLapTime, + PositionChange = row.PositionChange, + IRacingId = row.IRacingId, + SimSessionType = row.SimSessionType, + OldIRating = row.OldIRating, + NewIRating = row.NewIRating, + SeasonStartIRating = row.SeasonStartIRating, + License = row.License, + OldSafetyRating = row.OldSafetyRating, + NewSafetyRating = row.NewSafetyRating, + OldCpi = row.OldCpi, + NewCpi = row.NewCpi, + ClubId = row.ClubId, + ClubName = row.ClubName, + CarId = row.CarId, + CompletedPct = row.CompletedPct, + QualifyingTimeAt = row.QualifyingTimeAt, + Division = row.Division, + OldLicenseLevel = row.OldLicenseLevel, + NewLicenseLevel = row.NewLicenseLevel, + NumPitStops = row.NumPitStops, + PittedLaps = row.PittedLaps, + NumOfftrackLaps = row.NumOfftrackLaps, + OfftrackLaps = row.OfftrackLaps, + NumContactLaps = row.NumContactLaps, + ContactLaps = row.ContactLaps, + RacePoints = row.RacePoints, + TeamId = row.TeamId, + PointsEligible = row.PointsEligible, + }).ToList(), + }).ToList(), + }; +} diff --git a/src/iRLeagueApiCore.Server/Handlers/Results/ModifyResultRowHandler.cs b/src/iRLeagueApiCore.Server/Handlers/Results/ModifyResultRowHandler.cs new file mode 100644 index 00000000..d410f03e --- /dev/null +++ b/src/iRLeagueApiCore.Server/Handlers/Results/ModifyResultRowHandler.cs @@ -0,0 +1,143 @@ +using iRLeagueApiCore.Common.Models; +using iRLeagueApiCore.Services.ResultService.Excecution; + +namespace iRLeagueApiCore.Server.Handlers.Results; + +public record ModifyResultRowRequest(long ResultRowId, RawResultRowModel Row, bool TriggerCalculation = false) : IRequest; + +public class ModifyResultRowHandler : ResultHandlerBase +{ + private readonly IResultCalculationQueue calculationQueue; + + public ModifyResultRowHandler(ILogger logger, LeagueDbContext dbContext, IEnumerable> validators, + IResultCalculationQueue calculationQueue) : base(logger, dbContext, validators) + { + this.calculationQueue = calculationQueue; + } + + public override async Task Handle(ModifyResultRowRequest request, CancellationToken cancellationToken) + { + await validators.ValidateAllAndThrowAsync(request, cancellationToken); + var row = await GetResultRowEntityAsync(request.ResultRowId, cancellationToken) + ?? throw new ResourceNotFoundException(); + await MapToResultRowEntity(row, request.Row); + await dbContext.SaveChangesAsync(cancellationToken); + + if (request.TriggerCalculation) + { + var eventId = await dbContext.ResultRows + .Where(x => x.ResultRowId == row.ResultRowId) + .Select(x => x.SubResult.EventId) + .FirstOrDefaultAsync(cancellationToken); + await calculationQueue.QueueEventResultAsync(eventId); + } + + return MapToModResultRowModel(request.Row, row); + } + + private async Task GetResultRowEntityAsync(long resultRowId, CancellationToken cancellationToken) + { + return await dbContext.ResultRows. + FirstOrDefaultAsync(x => resultRowId == x.ResultRowId, cancellationToken); + } + + private async Task MapToResultRowEntity(ResultRowEntity entity, RawResultRowModel model) + { + entity.StartPosition = model.StartPosition; + entity.FinishPosition = model.FinishPosition; + entity.CarNumber = model.CarNumber; + entity.ClassId = model.ClassId; + entity.Car = model.Car; + entity.CarClass = model.CarClass; + entity.CompletedLaps = model.CompletedLaps; + entity.LeadLaps = model.LeadLaps; + entity.FastLapNr = model.FastLapNr; + entity.Incidents = model.Incidents; + entity.Status = model.Status; + entity.QualifyingTime = model.QualifyingTime; + entity.Interval = model.Interval; + entity.AvgLapTime = model.AvgLapTime; + entity.FastestLapTime = model.FastestLapTime; + entity.PositionChange = model.PositionChange; + entity.IRacingId = model.IRacingId; + entity.SimSessionType = model.SimSessionType; + entity.OldIRating = model.OldIRating; + entity.NewIRating = model.NewIRating; + entity.SeasonStartIRating = model.SeasonStartIRating; + entity.License = model.License; + entity.OldSafetyRating = model.OldSafetyRating; + entity.NewSafetyRating = model.NewSafetyRating; + entity.OldCpi = model.OldCpi; + entity.NewCpi = model.NewCpi; + entity.ClubId = model.ClubId; + entity.ClubName = model.ClubName; + entity.CarId = model.CarId; + entity.CompletedPct = model.CompletedPct; + entity.QualifyingTimeAt = model.QualifyingTimeAt; + entity.Division = model.Division; + entity.OldLicenseLevel = model.OldLicenseLevel; + entity.NewLicenseLevel = model.NewLicenseLevel; + entity.NumPitStops = model.NumPitStops; + entity.PittedLaps = model.PittedLaps; + entity.NumOfftrackLaps = model.NumOfftrackLaps; + entity.OfftrackLaps = model.OfftrackLaps; + entity.NumContactLaps = model.NumContactLaps; + entity.ContactLaps = model.ContactLaps; + entity.RacePoints = model.RacePoints; + var team = await dbContext.Teams + .FirstOrDefaultAsync(x => x.TeamId == model.TeamId); + entity.Team = team; + entity.PointsEligible = model.PointsEligible; + return entity; + } + + private static RawResultRowModel MapToModResultRowModel(RawResultRowModel model, ResultRowEntity entity) + { + model.ResultRowId = entity.ResultRowId; + model.MemberId = entity.MemberId; + model.StartPosition = entity.StartPosition; + model.FinishPosition = entity.FinishPosition; + model.CarNumber = entity.CarNumber; + model.ClassId = entity.ClassId; + model.Car = entity.Car; + model.CarClass = entity.CarClass; + model.CompletedLaps = entity.CompletedLaps; + model.LeadLaps = entity.LeadLaps; + model.FastLapNr = entity.FastLapNr; + model.Incidents = entity.Incidents; + model.Status = entity.Status; + model.QualifyingTime = entity.QualifyingTime; + model.Interval = entity.Interval; + model.AvgLapTime = entity.AvgLapTime; + model.FastestLapTime = entity.FastestLapTime; + model.PositionChange = entity.PositionChange; + model.IRacingId = entity.IRacingId; + model.SimSessionType = entity.SimSessionType; + model.OldIRating = entity.OldIRating; + model.NewIRating = entity.NewIRating; + model.SeasonStartIRating = entity.SeasonStartIRating; + model.License = entity.License; + model.OldSafetyRating = entity.OldSafetyRating; + model.NewSafetyRating = entity.NewSafetyRating; + model.OldCpi = entity.OldCpi; + model.NewCpi = entity.NewCpi; + model.ClubId = entity.ClubId; + model.ClubName = entity.ClubName; + model.CarId = entity.CarId; + model.CompletedPct = entity.CompletedPct; + model.QualifyingTimeAt = entity.QualifyingTimeAt; + model.Division = entity.Division; + model.OldLicenseLevel = entity.OldLicenseLevel; + model.NewLicenseLevel = entity.NewLicenseLevel; + model.NumPitStops = entity.NumPitStops; + model.PittedLaps = entity.PittedLaps; + model.NumOfftrackLaps = entity.NumOfftrackLaps; + model.OfftrackLaps = entity.OfftrackLaps; + model.NumContactLaps = entity.NumContactLaps; + model.ContactLaps = entity.ContactLaps; + model.RacePoints = entity.RacePoints; + model.TeamId = entity.TeamId; + model.PointsEligible = entity.PointsEligible; + return model; + } +} diff --git a/src/iRLeagueApiCore.Server/Startup.cs b/src/iRLeagueApiCore.Server/Startup.cs index 7154dad1..e1f21e1d 100644 --- a/src/iRLeagueApiCore.Server/Startup.cs +++ b/src/iRLeagueApiCore.Server/Startup.cs @@ -59,10 +59,6 @@ public void ConfigureServices(IServiceCollection services) options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; }); - services.AddControllers().AddJsonOptions(option => - { - option.JsonSerializerOptions.Converters.Add(new JsonTimeSpanConverter()); - }); services.AddSwaggerGen(c => { var readHostUrls = Configuration["ASPNETCORE_HOSTURLS"]; diff --git a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj index 32eb8d8b..9593859d 100644 --- a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj +++ b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj @@ -71,7 +71,7 @@ true - 0.11.4 + 0.11.5-dev.7 enable diff --git a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj index f0541e29..d9550059 100644 --- a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj +++ b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj @@ -28,7 +28,7 @@ net6.0 11 iRLeagueDatabaseCore - 0.11.1 + 0.11.5-dev.7 enable