Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Driver/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ private static async Task Main(String[] args) {

private static async Task QueryTest(){
String query = "fromStream('$et-EstateCreatedEvent')\r\n .when({\r\n $init: function (s, e)\r\n {\r\n return {\r\n estates:[]\r\n };\r\n },\r\n \"EstateCreatedEvent\": function(s,e){\r\n s.estates.push(e.data.estateName);\r\n }\r\n });";
EventStoreClient client = new EventStoreClient(Program.ConfigureEventStoreSettings());
EventStoreProjectionManagementClient projection = new EventStoreProjectionManagementClient(Program.ConfigureEventStoreSettings());
EventStoreContext context = new EventStoreContext(client, projection);
EventStoreClient client = new(Program.ConfigureEventStoreSettings());
EventStoreProjectionManagementClient projection = new(Program.ConfigureEventStoreSettings());
EventStoreContext context = new(client, projection);

var result = await context.RunTransientQuery(query, CancellationToken.None);
Console.WriteLine(result);
Expand Down
2 changes: 1 addition & 1 deletion Shared.EventStore/Aggregate/Aggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void ApplyAndAppend(IDomainEvent domainEvent) {
this.PendingEvents.Add(domainEvent);
}
catch(Exception e) {
Exception ex = new Exception($"Failed to apply event {domainEvent.EventType} to Aggregate {this.GetType().Name}", e);
Exception ex = new($"Failed to apply event {domainEvent.EventType} to Aggregate {this.GetType().Name}", e);

throw ex;
}
Expand Down
2 changes: 1 addition & 1 deletion Shared.EventStore/Aggregate/AggregateRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private Result<TAggregate> ProcessEvents(TAggregate aggregate,
}
catch (Exception e) {
Exception ex =
new Exception(
new(
$"Failed to apply domain event {@event.EventType} to Aggregate {aggregate.GetType()} ",
e);
throw ex;
Expand Down
2 changes: 1 addition & 1 deletion Shared.EventStore/Aggregate/DomainEventFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DomainEventFactory : IDomainEventFactory<DomainEvent>
/// </summary>
public DomainEventFactory()
{
JsonIgnoreAttributeIgnorerContractResolver jsonIgnoreAttributeIgnorerContractResolver = new JsonIgnoreAttributeIgnorerContractResolver();
JsonIgnoreAttributeIgnorerContractResolver jsonIgnoreAttributeIgnorerContractResolver = new();

JsonConvert.DefaultSettings = () =>
{
Expand Down
2 changes: 1 addition & 1 deletion Shared.EventStore/Aggregate/EventDataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public EventData CreateEventData(IDomainEvent domainEvent)

Byte[] data = Encoding.Default.GetBytes(JsonConvert.SerializeObject(domainEvent));

EventData eventData = new EventData(Uuid.FromGuid(domainEvent.EventId), domainEvent.EventType, data);
EventData eventData = new(Uuid.FromGuid(domainEvent.EventId), domainEvent.EventType, data);

return eventData;
}
Expand Down
4 changes: 2 additions & 2 deletions Shared.EventStore/Aggregate/TypeMapConvertor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class TypeMapConvertor
/// <summary>
/// The domain event record factory
/// </summary>
private static readonly DomainEventFactory StandardDomainEventFactory = new DomainEventFactory();
private static readonly DomainEventFactory StandardDomainEventFactory = new();

private static IDomainEventFactory<IDomainEvent> OverrideDomainEventFactory = null;

Expand Down Expand Up @@ -62,7 +62,7 @@ public static IDomainEvent Convertor(Guid aggregateId, ResolvedEvent @event)
/// <returns></returns>
public static EventData Convertor(IDomainEvent @event)
{
EventDataFactory eventDataFactory = new EventDataFactory();
EventDataFactory eventDataFactory = new();
return eventDataFactory.CreateEventData(@event);
}

Expand Down
2 changes: 1 addition & 1 deletion Shared.EventStore/EventStore/EventStoreContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public async Task<Result<String>> RunTransientQuery(String query, CancellationTo
catch (RpcException rex)
{
this.LogError(rex);
Exception ex = new Exception(ProjectionRunningStatus.Faulted.ToString(), rex);
Exception ex = new(ProjectionRunningStatus.Faulted.ToString(), rex);
return Result.Failure(ex.GetExceptionMessages());
}
finally
Expand Down
6 changes: 3 additions & 3 deletions Shared.EventStoreContext.Tests/EventStoreContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public EventStoreContextTests()
{
NlogLogger logger = new NlogLogger();
NlogLogger logger = new();
LogManager.Setup(b => {
b.SetupLogFactory(setup => setup.AddCallSiteHiddenAssembly(typeof(NlogLogger).Assembly));
b.SetupLogFactory(setup => setup.AddCallSiteHiddenAssembly(typeof(Shared.Logger.Logger).Assembly));
Expand All @@ -30,7 +30,7 @@

logger.Initialise(LogManager.GetLogger("Reqnroll"), "Reqnroll");

this.EventStoreDockerHelper = new EventStoreDockerHelper { Logger = logger };
this.EventStoreDockerHelper = new() { Logger = logger };
}

#endregion
Expand All @@ -42,8 +42,8 @@
}

[OneTimeTearDown]
public async Task TearDown(){

Check warning on line 45 in Shared.EventStoreContext.Tests/EventStoreContextTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 45 in Shared.EventStoreContext.Tests/EventStoreContextTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Windows

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
DockerServices sharedDockerServices = DockerServices.SqlServer;

Check warning on line 46 in Shared.EventStoreContext.Tests/EventStoreContextTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Linux

The variable 'sharedDockerServices' is assigned but its value is never used

Check warning on line 46 in Shared.EventStoreContext.Tests/EventStoreContextTests.cs

View workflow job for this annotation

GitHub Actions / Build and Test Pull Requests - Windows

The variable 'sharedDockerServices' is assigned but its value is never used

//await this.EventStoreDockerHelper.StopContainersForScenarioRun(sharedDockerServices);
}
Expand All @@ -66,7 +66,7 @@
[TestCase("COMPLETED/STOPPED/WRITING RESULTS", ProjectionRunningStatus.Completed)]
[TestCase("Unknown", ProjectionRunningStatus.Unknown)]
public void EventStoreContext_GetStatusFrom_CorrectValueReturned(String status, ProjectionRunningStatus expected){
ProjectionDetails projectionDetails = new ProjectionDetails(0,
ProjectionDetails projectionDetails = new(0,
0,
0,
String.Empty,
Expand Down
2 changes: 1 addition & 1 deletion Shared/EntityFramework/DbContextResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ResolvedDbContext<TContext> Resolve(String connectionStringKey, String da

// Update the connection string with the identifier if needed
if (!String.IsNullOrWhiteSpace(databaseNameSuffix)) {
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString);
SqlConnectionStringBuilder builder = new(connectionString);
builder.InitialCatalog = $"{builder.InitialCatalog}-{databaseNameSuffix}";
connectionString = builder.ConnectionString;

Expand Down
Loading