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:
parent
619fa02ab3
commit
b355aeb8ff
@ -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,
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using CleanArchitecture.Application.Interfaces;
|
||||
using CleanArchitecture.Application.Queries.Users.GetAll;
|
||||
|
@ -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;
|
||||
|
@ -23,7 +23,6 @@ public sealed class PagedResult<T>
|
||||
// used by json deserializer
|
||||
private PagedResult()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static PagedResult<T> Empty()
|
||||
|
@ -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}";
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user