Genral clean up and moving of code.
This commit is contained in:
@@ -6,9 +6,9 @@ namespace FinancialApi.Infrastructure;
|
||||
|
||||
public class AccountQuery(AccountDbContext db) : IAccountQuery
|
||||
{
|
||||
public Task<Account?> FindByIdAsync(int id)
|
||||
public async Task<Account?> FindByIdAsync(int id)
|
||||
{
|
||||
return db.Accounts.AsNoTracking()
|
||||
return await db.Accounts.AsNoTracking()
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using FinancialApi.Domain.Events;
|
||||
|
||||
namespace FinancialApi.Infrastructure;
|
||||
|
||||
public class DemoEventStore : IEventTracker
|
||||
{
|
||||
public List<string> CapturedEvents { get; } = new();
|
||||
|
||||
public void Add(string eventMessage)
|
||||
{
|
||||
CapturedEvents.Add($"[{DateTimeOffset.UtcNow:HH:mm:ss}] {eventMessage}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user