This commit is contained in:
Michele 2020-11-18 00:01:29 +00:00
parent e988f5c310
commit 1b910adf55
9 changed files with 108 additions and 111 deletions

View file

@ -24,9 +24,8 @@ namespace Sledgemapper.Api.Commands
public class GetMapSnapshotCommandHandler : IRequestHandler<GetMapSnapshotCommand, Sledgemapper.Shared.Entities.Session>
{
private readonly MyDbContext _dbcontext;
private readonly IMediator _mediator;
public GetMapSnapshotCommandHandler(IMediator mediator, MyDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
public GetMapSnapshotCommandHandler(MyDbContext dbcontext) { _dbcontext = dbcontext; }
public async Task<Sledgemapper.Shared.Entities.Session> Handle(GetMapSnapshotCommand notification, CancellationToken cancellationToken)
{
@ -100,13 +99,7 @@ namespace Sledgemapper.Api.Commands
await _dbcontext.Snapshots.AddAsync(newSnapshot);
await _dbcontext.SaveChangesAsync();
}
return mapSession;
}
}
}