Skip to content

Commit

Permalink
update code format
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Apr 11, 2023
1 parent 10aefbc commit 2fe485f
Show file tree
Hide file tree
Showing 534 changed files with 24,951 additions and 24,649 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ end_of_line = crlf
[*.sh]
end_of_line = lf

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
dotnet_style_namespace_match_folder = true

[*.cs]
csharp_using_directive_placement = outside_namespace
csharp_style_namespace_declarations = file_scoped:warning
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class AuthenticateEntityIdentifierCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityIdentifierCommand<TKey, TReadModel>, TReadModel>
{
public class AuthenticateEntityIdentifierCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityIdentifierCommand<TKey, TReadModel>, TReadModel>
public AuthenticateEntityIdentifierCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public AuthenticateEntityIdentifierCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}
}

protected override async Task<TReadModel> Process(EntityIdentifierCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
protected override async Task<TReadModel> Process(EntityIdentifierCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class TrackChangeEntityPatchCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityPatchCommand<TKey, TReadModel>, TReadModel>
{
public class TrackChangeEntityPatchCommandBehavior<TKey, TReadModel>
: PipelineBehaviorBase<EntityPatchCommand<TKey, TReadModel>, TReadModel>
public TrackChangeEntityPatchCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public TrackChangeEntityPatchCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}

protected override async Task<TReadModel> Process(EntityPatchCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}

protected override async Task<TReadModel> Process(EntityPatchCommand<TKey, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@

using Microsoft.Extensions.Logging;

namespace InstructorIQ.Core.Behaviors
namespace InstructorIQ.Core.Behaviors;

public class TrackChangeEntityUpdateCommandBehavior<TKey, TUpdateModel, TReadModel>
: PipelineBehaviorBase<EntityUpdateCommand<TKey, TUpdateModel, TReadModel>, TReadModel>
{
public class TrackChangeEntityUpdateCommandBehavior<TKey, TUpdateModel, TReadModel>
: PipelineBehaviorBase<EntityUpdateCommand<TKey, TUpdateModel, TReadModel>, TReadModel>
public TrackChangeEntityUpdateCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
public TrackChangeEntityUpdateCommandBehavior(ILoggerFactory loggerFactory) : base(loggerFactory)
{
}
}

protected override async Task<TReadModel> Process(EntityUpdateCommand<TKey, TUpdateModel, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
protected override async Task<TReadModel> Process(EntityUpdateCommand<TKey, TUpdateModel, TReadModel> request, RequestHandlerDelegate<TReadModel> next, CancellationToken cancellationToken)
{
// continue pipeline
return await next().ConfigureAwait(false);
}
}
25 changes: 12 additions & 13 deletions service/src/InstructorIQ.Core/Converters/TimeSpanConverter.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
using System;
using System;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace InstructorIQ.Core.Converters
namespace InstructorIQ.Core.Converters;

public class TimeSpanConverter : JsonConverter<TimeSpan>
{
public class TimeSpanConverter : JsonConverter<TimeSpan>
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var stringValue = reader.GetString();
return TimeSpan.Parse(stringValue);
}
var stringValue = reader.GetString();
return TimeSpan.Parse(stringValue);
}

public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
{
var stringValue = value.ToString();
writer.WriteStringValue(stringValue);
}
public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options)
{
var stringValue = value.ToString();
writer.WriteStringValue(stringValue);
}
}
35 changes: 17 additions & 18 deletions service/src/InstructorIQ.Core/Data/Constants/Role.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class Role
{
public static class Role
{
///<summary>Member for organization</summary>
public static readonly Guid Member = new Guid("d373fbb2-39eb-e711-87c1-708bcd56aa6d");
///<summary>User that can attend sessions</summary>
public static readonly Guid Attendee = new Guid("d9fb92e7-a5e8-4fe3-86ba-16924e44fb86");
///<summary>Instructor for organization</summary>
public static readonly Guid Instructor = new Guid("808c0ec0-39eb-e711-87c1-708bcd56aa6d");
///<summary>Administrator for organization</summary>
public static readonly Guid Administrator = new Guid("8fa6aec8-39eb-e711-87c1-708bcd56aa6d");
///<summary>Member for organization</summary>
public static readonly Guid Member = new Guid("d373fbb2-39eb-e711-87c1-708bcd56aa6d");
///<summary>User that can attend sessions</summary>
public static readonly Guid Attendee = new Guid("d9fb92e7-a5e8-4fe3-86ba-16924e44fb86");
///<summary>Instructor for organization</summary>
public static readonly Guid Instructor = new Guid("808c0ec0-39eb-e711-87c1-708bcd56aa6d");
///<summary>Administrator for organization</summary>
public static readonly Guid Administrator = new Guid("8fa6aec8-39eb-e711-87c1-708bcd56aa6d");

public const string MemberName = "Member";
public const string AttendeeName = "Attendee";
public const string InstructorName = "Instructor";
public const string AdministratorName = "Administrator";
public const string GlobalAdministrator = "GlobalAdministrator";
public const string MemberName = "Member";
public const string AttendeeName = "Attendee";
public const string InstructorName = "Instructor";
public const string AdministratorName = "Administrator";
public const string GlobalAdministrator = "GlobalAdministrator";

}
}
11 changes: 5 additions & 6 deletions service/src/InstructorIQ.Core/Data/Constants/TemplateType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class TemplateType
{
public static class TemplateType
{
public const string Editor = "Editor";
}
public const string Editor = "Editor";
}
19 changes: 9 additions & 10 deletions service/src/InstructorIQ.Core/Data/Constants/Tenant.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class Tenant
{
public static class Tenant
{
///<summary>Test Organization</summary>
public static readonly Guid Test = new Guid("2a3080d2-a9ec-e711-87c2-708bcd56aa6d");
///<summary>Demo Organization</summary>
public static readonly Guid Demo = new Guid("e8a8db6e-2feb-e711-87c1-708bcd56aa6d");
}
}
///<summary>Test Organization</summary>
public static readonly Guid Test = new Guid("2a3080d2-a9ec-e711-87c2-708bcd56aa6d");
///<summary>Demo Organization</summary>
public static readonly Guid Demo = new Guid("e8a8db6e-2feb-e711-87c1-708bcd56aa6d");
}
19 changes: 9 additions & 10 deletions service/src/InstructorIQ.Core/Data/Constants/User.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System;

namespace InstructorIQ.Core.Data.Constants
namespace InstructorIQ.Core.Data.Constants;

public static class User
{
public static class User
{
///<summary>Test User</summary>
public static readonly System.Guid Test = new Guid("52ae0c20-c4de-e711-87bf-708bcd56aa6d");
///<summary>InstructorIQ Support</summary>
public static readonly System.Guid Support = new Guid("2a31eec5-30eb-e711-87c1-708bcd56aa6d");
}
}
///<summary>Test User</summary>
public static readonly System.Guid Test = new Guid("52ae0c20-c4de-e711-87bf-708bcd56aa6d");
///<summary>InstructorIQ Support</summary>
public static readonly System.Guid Support = new Guid("2a31eec5-30eb-e711-87c1-708bcd56aa6d");
}
37 changes: 18 additions & 19 deletions service/src/InstructorIQ.Core/Data/DataServiceModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace InstructorIQ.Core.Data
namespace InstructorIQ.Core.Data;

public class DataServiceModule
{
public class DataServiceModule
{

[RegisterServices]
public void Register(IServiceCollection services)
[RegisterServices]
public void Register(IServiceCollection services)
{
services.AddDbContextPool<InstructorIQContext>((provider, options) =>
{
services.AddDbContextPool<InstructorIQContext>((provider, options) =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
});
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
});

services.TryAddSingleton<IDataConfiguration>(provider =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
return new DataConfiguration(SqlClientFactory.Instance, connectionString);
});
services.TryAddSingleton<IDataConfiguration>(provider =>
{
var configuration = provider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("InstructorIQ");
return new DataConfiguration(SqlClientFactory.Instance, connectionString);
});

services.TryAddTransient<IDataSession, DataSession>();
}
services.TryAddTransient<IDataSession, DataSession>();
}
}
Loading

0 comments on commit 2fe485f

Please sign in to comment.