Skip to content

Commit

Permalink
C# 10 + clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsBergqvist committed Dec 28, 2023
1 parent aba8d9a commit 441725f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions BlazorApp/Client/BlazorApp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<LangVersion>10</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(RunConfiguration)' == 'BlazorApp' " />
Expand Down
2 changes: 1 addition & 1 deletion Core/CQRS/Commands/CollectPoliceEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Core.CQRS.Commands
{
public class CollectPoliceEvents
public abstract class CollectPoliceEvents
{
public class Command : IRequest
{
Expand Down
4 changes: 2 additions & 2 deletions Core/CQRS/Queries/GetPoliceEventById.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace Core.CQRS.Queries
{
public class GetPoliceEventById
public abstract class GetPoliceEventById
{
public class Query : IRequest<PoliceEventDetails>
{
public int Id { get; set; }
public int Id { get; }
public Query(int id) => Id = id;

}
Expand Down
6 changes: 3 additions & 3 deletions Core/CQRS/Queries/GetPoliceEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Core.CQRS.Queries
{
public class GetPoliceEvents
public abstract class GetPoliceEvents
{
public const int DefaultPage = 1;
public const int DefaultPageSize = 5;
Expand All @@ -28,7 +28,7 @@ public class QueryParameters

public class Query : IRequest<PoliceEventsResult>
{
public QueryParameters Parameters { get; set; }
public QueryParameters Parameters { get; }
public Query(QueryParameters parameters) => Parameters = parameters;

}
Expand All @@ -46,7 +46,7 @@ public async Task<PoliceEventsResult> Handle(Query query, CancellationToken canc
var defaultDate = DateTime.Now.Date;
var from = DateHelper.GetParsedDateOrDefault(query.Parameters.FromDate, defaultDate);
var to = DateHelper.GetParsedDateOrDefault(query.Parameters.ToDate, defaultDate);
var pagedResult = await _repository.GetEvents(from, to,
var pagedResult = await _repository.GetEvents(from, to,
query.Parameters.Page == 0 ? DefaultPage : query.Parameters.Page,
query.Parameters.PageSize == 0 ? DefaultPageSize : query.Parameters.PageSize,
query.Parameters.UserLat,
Expand Down
1 change: 1 addition & 0 deletions Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 441725f

Please sign in to comment.