mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-08-23 03:38:36 +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
|
public sealed class SetInactiveUsersService : BackgroundService
|
||||||
{
|
{
|
||||||
private readonly IServiceProvider _serviceProvider;
|
|
||||||
private readonly ILogger<SetInactiveUsersService> _logger;
|
private readonly ILogger<SetInactiveUsersService> _logger;
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
|
||||||
public SetInactiveUsersService(
|
public SetInactiveUsersService(
|
||||||
IServiceProvider serviceProvider,
|
IServiceProvider serviceProvider,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CleanArchitecture.Application.Interfaces;
|
using CleanArchitecture.Application.Interfaces;
|
||||||
using CleanArchitecture.Application.Queries.Users.GetAll;
|
using CleanArchitecture.Application.Queries.Users.GetAll;
|
||||||
|
@ -4,14 +4,15 @@ namespace CleanArchitecture.Application.ViewModels;
|
|||||||
|
|
||||||
public sealed class PageQuery
|
public sealed class PageQuery
|
||||||
{
|
{
|
||||||
|
private int _page = 1;
|
||||||
private int _pageSize = 10;
|
private int _pageSize = 10;
|
||||||
|
|
||||||
public int PageSize
|
public int PageSize
|
||||||
{
|
{
|
||||||
get => _pageSize;
|
get => _pageSize;
|
||||||
set => _pageSize = Math.Max(0, value);
|
set => _pageSize = Math.Max(0, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _page = 1;
|
|
||||||
public int Page
|
public int Page
|
||||||
{
|
{
|
||||||
get => _page;
|
get => _page;
|
||||||
|
@ -23,7 +23,6 @@ public sealed class PagedResult<T>
|
|||||||
// used by json deserializer
|
// used by json deserializer
|
||||||
private PagedResult()
|
private PagedResult()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PagedResult<T> Empty()
|
public static PagedResult<T> Empty()
|
||||||
|
@ -5,9 +5,13 @@ namespace CleanArchitecture.Domain;
|
|||||||
|
|
||||||
public static class CacheKeyGenerator
|
public static class CacheKeyGenerator
|
||||||
{
|
{
|
||||||
public static string GetEntityCacheKey<TEntity>(TEntity entity) where TEntity : Entity =>
|
public static string GetEntityCacheKey<TEntity>(TEntity entity) where TEntity : Entity
|
||||||
$"{typeof(TEntity)}-{entity.Id}";
|
{
|
||||||
|
return $"{typeof(TEntity)}-{entity.Id}";
|
||||||
public static string GetEntityCacheKey<TEntity>(Guid id) where TEntity : Entity =>
|
}
|
||||||
$"{typeof(TEntity)}-{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
|
public sealed class RabbitMqHandler : BackgroundService
|
||||||
{
|
{
|
||||||
|
private readonly IModel? _channel;
|
||||||
private readonly RabbitMqConfiguration _configuration;
|
private readonly RabbitMqConfiguration _configuration;
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<string, List<ConsumeEventHandler>> _consumers = new();
|
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 ConcurrentQueue<IRabbitMqAction> _pendingActions = new();
|
||||||
|
|
||||||
private readonly IModel? _channel;
|
|
||||||
|
|
||||||
public RabbitMqHandler(
|
public RabbitMqHandler(
|
||||||
RabbitMqConfiguration configuration,
|
RabbitMqConfiguration configuration,
|
||||||
ILogger<RabbitMqHandler> logger)
|
ILogger<RabbitMqHandler> logger)
|
||||||
|
@ -11,8 +11,8 @@ namespace CleanArchitecture.Infrastructure;
|
|||||||
public sealed class InMemoryBus : IMediatorHandler
|
public sealed class InMemoryBus : IMediatorHandler
|
||||||
{
|
{
|
||||||
private readonly IDomainEventStore _domainEventStore;
|
private readonly IDomainEventStore _domainEventStore;
|
||||||
private readonly IMediator _mediator;
|
|
||||||
private readonly IFanoutEventHandler _fanoutEventHandler;
|
private readonly IFanoutEventHandler _fanoutEventHandler;
|
||||||
|
private readonly IMediator _mediator;
|
||||||
|
|
||||||
public InMemoryBus(
|
public InMemoryBus(
|
||||||
IMediator mediator,
|
IMediator mediator,
|
||||||
|
Loading…
Reference in New Issue
Block a user