refactoring backend structure
This commit is contained in:
parent
dcc59f7b69
commit
0e1c16ab91
36 changed files with 786 additions and 454 deletions
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
|
@ -13,11 +13,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
|
||||
public class DeleteNoteCommandHandler : IRequestHandler<DeleteNoteCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public DeleteNoteCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public DeleteNoteCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
|
||||
public async Task<bool> Handle(DeleteNoteCommand notification, CancellationToken cancellationToken)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
using System.Linq;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class DeleteOverlayCommandHandler : IRequestHandler<DeleteOverlayCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public DeleteOverlayCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public DeleteOverlayCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(DeleteOverlayCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class DeleteTileCommandHandler : IRequestHandler<DeleteTileCommand,bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public DeleteTileCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public DeleteTileCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(DeleteTileCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
|
@ -13,11 +13,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
|
||||
public class DeleteWallCommandHandler : IRequestHandler<DeleteWallCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public DeleteWallCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public DeleteWallCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
|
||||
public async Task<bool> Handle(DeleteWallCommand notification, CancellationToken cancellationToken)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
@ -11,9 +11,9 @@ namespace Sledgemapper.Api.Commands
|
|||
{
|
||||
public class GetMapSnapshotCommandHandler : IRequestHandler<GetMapSnapshotCommand, Sledgemapper.Shared.Entities.Session>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
public GetMapSnapshotCommandHandler(MyDbContext dbcontext) { _dbcontext = dbcontext; }
|
||||
public GetMapSnapshotCommandHandler(SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; }
|
||||
|
||||
public async Task<Sledgemapper.Shared.Entities.Session> Handle(GetMapSnapshotCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using System.Linq;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class NewLineCommandHandler : IRequestHandler<NewLineCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewLineCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewLineCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewLineCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class NewNoteCommandHandler : IRequestHandler<NewNoteCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewNoteCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewNoteCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewNoteCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class NewOverlayCommandHandler : IRequestHandler<NewOverlayCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewOverlayCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewOverlayCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewOverlayCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using System.Linq;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class NewRoomCommandHandler : IRequestHandler<NewRoomCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewRoomCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewRoomCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewRoomCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
@ -10,10 +10,10 @@ namespace Sledgemapper.Api.Commands
|
|||
{
|
||||
public class NewSnapshotCommandHandler : IRequestHandler<NewSnapshotCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewSnapshotCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewSnapshotCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewSnapshotCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
@ -12,10 +12,10 @@ namespace Sledgemapper.Api.Commands
|
|||
{
|
||||
public class NewTileCommandHandler : IRequestHandler<NewTileCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewTileCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewTileCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewTileCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Shared.Entities;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
|
@ -12,11 +12,11 @@ namespace Sledgemapper.Api.Handlers
|
|||
{
|
||||
public class NewWallCommandHandler : IRequestHandler<NewWallCommand, bool>
|
||||
{
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
public NewWallCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
public NewWallCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
public async Task<bool> Handle(NewWallCommand notification, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// using MediatR;
|
||||
// using Sledgemapper.Api.Data;
|
||||
// using Sledgemapper.Api.Infrastructure.Data;
|
||||
// using System.Threading;
|
||||
// using System.Threading.Tasks;
|
||||
// using Sledgemapper.Api.Notifications;
|
||||
|
@ -9,10 +9,10 @@
|
|||
// {
|
||||
// public class PingCommandHandler : IRequestHandler<PingCommand, bool>
|
||||
// {
|
||||
// private readonly MyDbContext _dbcontext;
|
||||
// private readonly SledgemapperDbContext _dbcontext;
|
||||
// private readonly IMediator _mediator;
|
||||
|
||||
// public PingCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
// public PingCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
||||
|
||||
// public async Task<bool> Handle(PingCommand notification, CancellationToken cancellationToken)
|
||||
// {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MediatR;
|
||||
using Sledgemapper.Api.Commands;
|
||||
using Sledgemapper.Api.Data;
|
||||
using Sledgemapper.Api.Infrastructure.Data;
|
||||
using Sledgemapper.Api.Models;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -10,9 +10,9 @@ namespace Sledgemapper.Api.Handlers
|
|||
public class StartNewSessionHandler : IRequestHandler<NewSessionCommand, bool>
|
||||
{
|
||||
private readonly IMediator _mediator;
|
||||
private readonly MyDbContext _dbcontext;
|
||||
private readonly SledgemapperDbContext _dbcontext;
|
||||
|
||||
public StartNewSessionHandler(IMediator mediator, MyDbContext dbcontext)
|
||||
public StartNewSessionHandler(IMediator mediator, SledgemapperDbContext dbcontext)
|
||||
{
|
||||
_mediator = mediator;
|
||||
_dbcontext = dbcontext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue