0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-29 18:21:08 +00:00

chore: Code Cleanup

This commit is contained in:
alex289 2023-09-02 12:33:58 +02:00
parent 619fa02ab3
commit b355aeb8ff
No known key found for this signature in database
GPG Key ID: 573F77CD2D87F863
29 changed files with 105 additions and 103 deletions

View File

@ -15,8 +15,8 @@ namespace CleanArchitecture.Api.BackgroundServices;
public sealed class SetInactiveUsersService : BackgroundService
{
private readonly IServiceProvider _serviceProvider;
private readonly ILogger<SetInactiveUsersService> _logger;
private readonly IServiceProvider _serviceProvider;
public SetInactiveUsersService(
IServiceProvider serviceProvider,

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CleanArchitecture.Application.Interfaces;
using CleanArchitecture.Application.Queries.Users.GetAll;

View File

@ -4,14 +4,15 @@ namespace CleanArchitecture.Application.ViewModels;
public sealed class PageQuery
{
private int _page = 1;
private int _pageSize = 10;
public int PageSize
{
get => _pageSize;
set => _pageSize = Math.Max(0, value);
}
private int _page = 1;
public int Page
{
get => _page;

View File

@ -23,7 +23,6 @@ public sealed class PagedResult<T>
// used by json deserializer
private PagedResult()
{
}
public static PagedResult<T> Empty()

View File

@ -5,9 +5,13 @@ namespace CleanArchitecture.Domain;
public static class CacheKeyGenerator
{
public static string GetEntityCacheKey<TEntity>(TEntity entity) where TEntity : Entity =>
$"{typeof(TEntity)}-{entity.Id}";
public static string GetEntityCacheKey<TEntity>(Guid id) where TEntity : Entity =>
$"{typeof(TEntity)}-{id}";
public static string GetEntityCacheKey<TEntity>(TEntity entity) where TEntity : Entity
{
return $"{typeof(TEntity)}-{entity.Id}";
}
public static string GetEntityCacheKey<TEntity>(Guid id) where TEntity : Entity
{
return $"{typeof(TEntity)}-{id}";
}
}

View File

@ -13,6 +13,7 @@ namespace CleanArchitecture.Domain.Rabbitmq;
public sealed class RabbitMqHandler : BackgroundService
{
private readonly IModel? _channel;
private readonly RabbitMqConfiguration _configuration;
private readonly ConcurrentDictionary<string, List<ConsumeEventHandler>> _consumers = new();
@ -21,8 +22,6 @@ public sealed class RabbitMqHandler : BackgroundService
private readonly ConcurrentQueue<IRabbitMqAction> _pendingActions = new();
private readonly IModel? _channel;
public RabbitMqHandler(
RabbitMqConfiguration configuration,
ILogger<RabbitMqHandler> logger)

View File

@ -11,8 +11,8 @@ namespace CleanArchitecture.Infrastructure;
public sealed class InMemoryBus : IMediatorHandler
{
private readonly IDomainEventStore _domainEventStore;
private readonly IMediator _mediator;
private readonly IFanoutEventHandler _fanoutEventHandler;
private readonly IMediator _mediator;
public InMemoryBus(
IMediator mediator,