diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index bfb277bb..6f6d592f 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,5 +1,11 @@
version: 2
updates:
+- package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: daily
+ time: "02:00"
+ open-pull-requests-limit: 10
- package-ecosystem: nuget
directory: "/service/"
schedule:
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 5fc52acd..a43998eb 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -1,15 +1,19 @@
name: Build Project
env:
- BUILD_PATH: '${{github.workspace}}/publish'
- BUILD_VERSION: '1.8.${{github.run_number}}'
- BUILD_INFORMATION: '1.8.${{github.run_number}}+Branch.${{github.ref_name}}.Sha.${{github.sha}}'
+ DOTNET_NOLOGO: true
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+ DOTNET_ENVIRONMENT: github
+ ASPNETCORE_ENVIRONMENT: github
+ BUILD_PATH: '${{github.workspace}}/artifacts'
on:
push:
branches:
- master
- develop
+ tags:
+ - "v*"
pull_request:
branches:
- master
@@ -21,23 +25,23 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Setup .NET 7.0
+ - name: Setup .NET
uses: actions/setup-dotnet@v3
with:
- dotnet-version: 7.0.x
+ dotnet-version: 8.0.x
- name: Setup MSBuild
- uses: microsoft/setup-msbuild@v1.1
+ uses: microsoft/setup-msbuild@v1.3
- name: Restore Dependencies
run: dotnet restore ./service/InstructorIQ.sln
- name: Build Solution
- run: 'dotnet build ./service/InstructorIQ.sln --no-restore --configuration Release -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_INFORMATION}}"'
+ run: 'dotnet build ./service/InstructorIQ.sln --no-restore --configuration Release'
- name: Publish Web Application
if: success()
@@ -61,39 +65,53 @@ jobs:
name: Database
path: '${{env.BUILD_PATH}}/Database'
- deploy-website:
+
+ deploy-staging:
runs-on: ubuntu-latest
needs: build-project
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
+ environment:
+ name: Staging
+ url: https://staging.instructoriq.com/
+
steps:
+ - name: Download Database Artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: Database
+
- name: Download Web Application Artifact
uses: actions/download-artifact@v3
with:
name: WebApplication
- - name: Deploy Web Application to Azure Staging
- if: github.ref == 'refs/heads/develop'
- uses: azure/webapps-deploy@v2
+ - name: Deploy SQL Server Database to Azure
+ if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
+ uses: azure/sql-action@v2.2
+ with:
+ connection-string: ${{secrets.AZURE_SQL_CONNECTION_STAGING}}
+ path: './InstructorIQ.dacpac'
+ action: 'publish'
+
+ - name: Deploy Web Application to Azure
+ if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
+ uses: azure/webapps-deploy@v3
with:
app-name: 'web-ls-app-eus-iq-stg-01'
slot-name: 'Production'
publish-profile: ${{secrets.PUBLISH_PROFILE_STAGING}}
package: ./
- - name: Deploy Web Application to Azure Production
- if: github.ref == 'refs/heads/master'
- uses: azure/webapps-deploy@v2
- with:
- app-name: 'web-ls-app-eus-iq-prd-01'
- slot-name: 'Production'
- publish-profile: ${{secrets.PUBLISH_PROFILE_PRODUCTION}}
- package: ./
- deploy-database:
- runs-on: windows-latest
+ deploy-production:
+ runs-on: ubuntu-latest
needs: build-project
- if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
+ if: success() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
+
+ environment:
+ name: Production
+ url: https://instructoriq.com/
steps:
- name: Download Database Artifact
@@ -101,18 +119,24 @@ jobs:
with:
name: Database
- - name: Deploy SQL Server Database to Azure Staging
- if: github.ref == 'refs/heads/develop'
- uses: azure/sql-action@v2.1
+ - name: Download Web Application Artifact
+ uses: actions/download-artifact@v3
with:
- connection-string: ${{secrets.AZURE_SQL_CONNECTION_STAGING}}
- path: './InstructorIQ.dacpac'
- action: 'publish'
+ name: WebApplication
- - name: Deploy SQL Server Database to Azure Production
- if: github.ref == 'refs/heads/master'
- uses: azure/sql-action@v2.1
+ - name: Deploy SQL Server Database to Azure
+ if: success() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
+ uses: azure/sql-action@v2.2
with:
connection-string: ${{secrets.AZURE_SQL_CONNECTION_PRODUCTION}}
path: './InstructorIQ.dacpac'
action: 'publish'
+
+ - name: Deploy Web Application to Azure
+ if: success() && github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
+ uses: azure/webapps-deploy@v3
+ with:
+ app-name: 'web-ls-app-eus-iq-prd-01'
+ slot-name: 'Production'
+ publish-profile: ${{secrets.PUBLISH_PROFILE_PRODUCTION}}
+ package: ./
diff --git a/service/Directory.Build.props b/service/Directory.Build.props
index 150637b6..9528b953 100644
--- a/service/Directory.Build.props
+++ b/service/Directory.Build.props
@@ -16,9 +16,15 @@
1591
+
+ v
+
+
-
-
+
+
+
+
diff --git a/service/src/InstructorIQ.Core/Data/DataServiceModule.cs b/service/src/InstructorIQ.Core/Data/DataServiceModule.cs
index e2d4f6c6..b0dd139d 100644
--- a/service/src/InstructorIQ.Core/Data/DataServiceModule.cs
+++ b/service/src/InstructorIQ.Core/Data/DataServiceModule.cs
@@ -14,12 +14,16 @@ public class DataServiceModule
[RegisterServices]
public void Register(IServiceCollection services)
{
- services.AddDbContext((provider, options) =>
- {
- var configuration = provider.GetRequiredService();
- var connectionString = configuration.GetConnectionString("InstructorIQ");
- options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
- }, ServiceLifetime.Transient);
+ services.AddDbContext(
+ optionsAction: (provider, options) =>
+ {
+ var configuration = provider.GetRequiredService();
+ var connectionString = configuration.GetConnectionString("InstructorIQ");
+ options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
+ },
+ contextLifetime: ServiceLifetime.Transient,
+ optionsLifetime: ServiceLifetime.Transient
+ );
services.TryAddSingleton(provider =>
{
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Attendance.cs b/service/src/InstructorIQ.Core/Data/Entities/Attendance.cs
index dc0ae334..b938b005 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Attendance.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Attendance.cs
@@ -121,7 +121,7 @@ public Attendance()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -130,7 +130,7 @@ public Attendance()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Session Session { get; set; }
@@ -139,7 +139,7 @@ public Attendance()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/AuthenticationEvent.cs b/service/src/InstructorIQ.Core/Data/Entities/AuthenticationEvent.cs
index 17b172f3..863d371a 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/AuthenticationEvent.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/AuthenticationEvent.cs
@@ -154,7 +154,7 @@ public AuthenticationEvent()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Discussion.cs b/service/src/InstructorIQ.Core/Data/Entities/Discussion.cs
index 288cd368..bf04b21a 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Discussion.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Discussion.cs
@@ -170,7 +170,7 @@ public Discussion()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -195,7 +195,7 @@ public Discussion()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
@@ -204,7 +204,7 @@ public Discussion()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Topic Topic { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/EmailDelivery.cs b/service/src/InstructorIQ.Core/Data/Entities/EmailDelivery.cs
index 24134e6b..3b6ac1b8 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/EmailDelivery.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/EmailDelivery.cs
@@ -170,7 +170,7 @@ public EmailDelivery()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -179,7 +179,7 @@ public EmailDelivery()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/EmailTemplate.cs b/service/src/InstructorIQ.Core/Data/Entities/EmailTemplate.cs
index d3c6d61e..a57fae2d 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/EmailTemplate.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/EmailTemplate.cs
@@ -140,7 +140,7 @@ public EmailTemplate()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -149,7 +149,7 @@ public EmailTemplate()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Group.cs b/service/src/InstructorIQ.Core/Data/Entities/Group.cs
index 1ac32432..9b54e5fc 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Group.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Group.cs
@@ -107,7 +107,7 @@ public Group()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -132,7 +132,7 @@ public Group()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Sessions { get; set; }
@@ -140,7 +140,7 @@ public Group()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/HistoryRecord.cs b/service/src/InstructorIQ.Core/Data/Entities/HistoryRecord.cs
index a54664d4..70eb97a5 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/HistoryRecord.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/HistoryRecord.cs
@@ -194,7 +194,7 @@ public HistoryRecord()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
diff --git a/service/src/InstructorIQ.Core/Data/Entities/ImportJob.cs b/service/src/InstructorIQ.Core/Data/Entities/ImportJob.cs
index a797879f..35c8d755 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/ImportJob.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/ImportJob.cs
@@ -96,7 +96,7 @@ public ImportJob()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -105,7 +105,7 @@ public ImportJob()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/InstructorRole.cs b/service/src/InstructorIQ.Core/Data/Entities/InstructorRole.cs
index bac1c3a6..66a5d222 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/InstructorRole.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/InstructorRole.cs
@@ -92,7 +92,7 @@ public InstructorRole()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -101,7 +101,7 @@ public InstructorRole()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection SessionInstructors { get; set; }
@@ -109,7 +109,7 @@ public InstructorRole()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
@@ -118,7 +118,7 @@ public InstructorRole()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection TopicInstructors { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/LinkToken.cs b/service/src/InstructorIQ.Core/Data/Entities/LinkToken.cs
index a8834467..971ca73a 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/LinkToken.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/LinkToken.cs
@@ -89,7 +89,7 @@ public LinkToken()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Location.cs b/service/src/InstructorIQ.Core/Data/Entities/Location.cs
index 3d51c858..f23cc713 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Location.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Location.cs
@@ -179,7 +179,7 @@ public Location()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -204,7 +204,7 @@ public Location()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Sessions { get; set; }
@@ -212,7 +212,7 @@ public Location()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Notification.cs b/service/src/InstructorIQ.Core/Data/Entities/Notification.cs
index c7424235..96d6861a 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Notification.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Notification.cs
@@ -106,7 +106,7 @@ public Notification()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -115,7 +115,7 @@ public Notification()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Session.cs b/service/src/InstructorIQ.Core/Data/Entities/Session.cs
index 167d5144..591d7e71 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Session.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Session.cs
@@ -44,7 +44,7 @@ public Session()
///
/// The property value representing column 'StartDate'.
///
- public DateTime? StartDate { get; set; }
+ public DateOnly? StartDate { get; set; }
///
/// Gets or sets the property value representing column 'StartTime'.
@@ -52,7 +52,7 @@ public Session()
///
/// The property value representing column 'StartTime'.
///
- public TimeSpan? StartTime { get; set; }
+ public TimeOnly? StartTime { get; set; }
///
/// Gets or sets the property value representing column 'EndDate'.
@@ -60,7 +60,7 @@ public Session()
///
/// The property value representing column 'EndDate'.
///
- public DateTime? EndDate { get; set; }
+ public DateOnly? EndDate { get; set; }
///
/// Gets or sets the property value representing column 'EndTime'.
@@ -68,7 +68,7 @@ public Session()
///
/// The property value representing column 'EndTime'.
///
- public TimeSpan? EndTime { get; set; }
+ public TimeOnly? EndTime { get; set; }
///
/// Gets or sets the property value representing column 'TenantId'.
@@ -148,7 +148,7 @@ public Session()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -173,7 +173,7 @@ public Session()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Attendances { get; set; }
@@ -181,7 +181,7 @@ public Session()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Group Group { get; set; }
@@ -190,7 +190,7 @@ public Session()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Location Location { get; set; }
@@ -199,7 +199,7 @@ public Session()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection SessionInstructors { get; set; }
@@ -207,7 +207,7 @@ public Session()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
@@ -216,7 +216,7 @@ public Session()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Topic Topic { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/SessionInstructor.cs b/service/src/InstructorIQ.Core/Data/Entities/SessionInstructor.cs
index 90dd8752..6b0d2514 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/SessionInstructor.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/SessionInstructor.cs
@@ -90,7 +90,7 @@ public SessionInstructor()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -115,7 +115,7 @@ public SessionInstructor()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual InstructorRole InstructorRole { get; set; }
@@ -124,7 +124,7 @@ public SessionInstructor()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Session Session { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/SignUp.cs b/service/src/InstructorIQ.Core/Data/Entities/SignUp.cs
index b82f9ecf..28dab3a1 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/SignUp.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/SignUp.cs
@@ -91,7 +91,7 @@ public SignUp()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -100,7 +100,7 @@ public SignUp()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection SignUpTopics { get; set; }
@@ -108,7 +108,7 @@ public SignUp()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/SignUpTopic.cs b/service/src/InstructorIQ.Core/Data/Entities/SignUpTopic.cs
index 7dcafe8c..bdbe8345 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/SignUpTopic.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/SignUpTopic.cs
@@ -82,7 +82,7 @@ public SignUpTopic()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
#endregion
@@ -91,7 +91,7 @@ public SignUpTopic()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual SignUp SignUp { get; set; }
@@ -100,7 +100,7 @@ public SignUpTopic()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Topic Topic { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Template.cs b/service/src/InstructorIQ.Core/Data/Entities/Template.cs
index c437a1d7..55d52abf 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Template.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Template.cs
@@ -106,7 +106,7 @@ public Template()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -131,7 +131,7 @@ public Template()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Tenant.cs b/service/src/InstructorIQ.Core/Data/Entities/Tenant.cs
index 55692496..f9897f16 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Tenant.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Tenant.cs
@@ -145,7 +145,7 @@ public Tenant()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -170,7 +170,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Attendances { get; set; }
@@ -178,7 +178,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Discussions { get; set; }
@@ -186,7 +186,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection EmailDeliveries { get; set; }
@@ -194,7 +194,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection EmailTemplates { get; set; }
@@ -202,7 +202,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Groups { get; set; }
@@ -210,7 +210,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection ImportJobs { get; set; }
@@ -218,7 +218,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection InstructorRoles { get; set; }
@@ -226,7 +226,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection LinkTokens { get; set; }
@@ -234,7 +234,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Locations { get; set; }
@@ -242,7 +242,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Notifications { get; set; }
@@ -250,7 +250,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Sessions { get; set; }
@@ -258,7 +258,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection SignUps { get; set; }
@@ -266,7 +266,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Templates { get; set; }
@@ -274,7 +274,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection TenantUserRoles { get; set; }
@@ -282,7 +282,7 @@ public Tenant()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Topics { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/TenantUserRole.cs b/service/src/InstructorIQ.Core/Data/Entities/TenantUserRole.cs
index 114c22e9..4f5330d6 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/TenantUserRole.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/TenantUserRole.cs
@@ -57,7 +57,7 @@ public TenantUserRole()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/Topic.cs b/service/src/InstructorIQ.Core/Data/Entities/Topic.cs
index f54ce42a..658d678e 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/Topic.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/Topic.cs
@@ -166,7 +166,7 @@ public Topic()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -191,7 +191,7 @@ public Topic()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Discussions { get; set; }
@@ -199,7 +199,7 @@ public Topic()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection Sessions { get; set; }
@@ -207,7 +207,7 @@ public Topic()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection SignUpTopics { get; set; }
@@ -215,7 +215,7 @@ public Topic()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Tenant Tenant { get; set; }
@@ -224,7 +224,7 @@ public Topic()
/// Gets or sets the navigation collection for entity .
///
///
- /// The the navigation collection for entity .
+ /// The navigation collection for entity .
///
public virtual ICollection TopicInstructors { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Entities/TopicInstructor.cs b/service/src/InstructorIQ.Core/Data/Entities/TopicInstructor.cs
index be24c954..5c0cebe2 100644
--- a/service/src/InstructorIQ.Core/Data/Entities/TopicInstructor.cs
+++ b/service/src/InstructorIQ.Core/Data/Entities/TopicInstructor.cs
@@ -90,7 +90,7 @@ public TopicInstructor()
///
/// The property value representing column 'RowVersion'.
///
- public Byte[] RowVersion { get; set; }
+ public long RowVersion { get; set; }
///
/// Gets or sets the property value representing column 'PeriodStart'.
@@ -115,7 +115,7 @@ public TopicInstructor()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual InstructorRole InstructorRole { get; set; }
@@ -124,7 +124,7 @@ public TopicInstructor()
/// Gets or sets the navigation property for entity .
///
///
- /// The the navigation property for entity .
+ /// The navigation property for entity .
///
///
public virtual Topic Topic { get; set; }
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/AttendanceMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/AttendanceMap.cs
index d3103198..59225dda 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/AttendanceMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/AttendanceMap.cs
@@ -91,10 +91,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -112,7 +113,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -120,7 +121,7 @@ public struct Table
public const string Name = "Attendance";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/AuthenticationEventMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/AuthenticationEventMap.cs
index 18b1cd6a..1e3bf668 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/AuthenticationEventMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/AuthenticationEventMap.cs
@@ -80,7 +80,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsSuccessful)
.IsRequired()
.HasColumnName("IsSuccessful")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.FailureMessage)
.HasColumnName("FailureMessage")
@@ -111,10 +112,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -122,7 +124,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -130,7 +132,7 @@ public struct Table
public const string Name = "AuthenticationEvent";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/DiscussionMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/DiscussionMap.cs
index e9104538..581367d7 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/DiscussionMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/DiscussionMap.cs
@@ -121,23 +121,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Tenant)
@@ -160,7 +159,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -168,7 +167,7 @@ public struct Table
public const string Name = "Discussion";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/EmailDeliveryMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/EmailDeliveryMap.cs
index 1f44f305..7e0993b9 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/EmailDeliveryMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/EmailDeliveryMap.cs
@@ -34,12 +34,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsProcessing)
.IsRequired()
.HasColumnName("IsProcessing")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.IsDelivered)
.IsRequired()
.HasColumnName("IsDelivered")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.Delivered)
.HasColumnName("Delivered")
@@ -48,7 +50,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.Attempts)
.IsRequired()
.HasColumnName("Attempts")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasDefaultValue(0);
builder.Property(t => t.LastAttempt)
.HasColumnName("LastAttempt")
@@ -113,10 +116,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -129,7 +133,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -137,7 +141,7 @@ public struct Table
public const string Name = "EmailDelivery";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/EmailTemplateMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/EmailTemplateMap.cs
index 2f5a5003..b188188f 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/EmailTemplateMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/EmailTemplateMap.cs
@@ -99,10 +99,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -115,7 +116,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -123,7 +124,7 @@ public struct Table
public const string Name = "EmailTemplate";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/GroupMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/GroupMap.cs
index 8d5b0db5..7e4a5f15 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/GroupMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/GroupMap.cs
@@ -44,12 +44,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.Sequence)
.IsRequired()
.HasColumnName("Sequence")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasDefaultValue(0);
builder.Property(t => t.DisplayOrder)
.IsRequired()
.HasColumnName("DisplayOrder")
- .HasColumnType("int");
+ .HasColumnType("int")
+ .HasDefaultValue(0);
builder.Property(t => t.TenantId)
.IsRequired()
@@ -80,23 +82,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Tenant)
@@ -114,7 +115,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -122,7 +123,7 @@ public struct Table
public const string Name = "Group";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/HistoryRecordMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/HistoryRecordMap.cs
index 0c17d4cf..13595817 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/HistoryRecordMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/HistoryRecordMap.cs
@@ -134,10 +134,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -145,7 +146,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -153,7 +154,7 @@ public struct Table
public const string Name = "HistoryRecord";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/ImportJobMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/ImportJobMap.cs
index dc15a4f3..9e3be550 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/ImportJobMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/ImportJobMap.cs
@@ -74,10 +74,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -90,7 +91,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -98,7 +99,7 @@ public struct Table
public const string Name = "ImportJob";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/InstructorRoleMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/InstructorRoleMap.cs
index b5c5061b..5d3c648c 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/InstructorRoleMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/InstructorRoleMap.cs
@@ -70,10 +70,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -86,7 +87,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -94,7 +95,7 @@ public struct Table
public const string Name = "InstructorRole";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/LinkTokenMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/LinkTokenMap.cs
index 2d854d81..3727f0f3 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/LinkTokenMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/LinkTokenMap.cs
@@ -76,7 +76,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -84,7 +84,7 @@ public struct Table
public const string Name = "LinkToken";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/LocationMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/LocationMap.cs
index 59944442..b3d2db9a 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/LocationMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/LocationMap.cs
@@ -123,23 +123,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Tenant)
@@ -157,7 +156,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -165,7 +164,7 @@ public struct Table
public const string Name = "Location";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/NotificationMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/NotificationMap.cs
index 9b8e0bac..107d6027 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/NotificationMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/NotificationMap.cs
@@ -80,10 +80,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -96,7 +97,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -104,7 +105,7 @@ public struct Table
public const string Name = "Notification";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/RefreshTokenMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/RefreshTokenMap.cs
index e1ca24ec..2d5b63e4 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/RefreshTokenMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/RefreshTokenMap.cs
@@ -67,7 +67,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -75,7 +75,7 @@ public struct Table
public const string Name = "RefreshToken";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/SessionInstructorMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/SessionInstructorMap.cs
index 45cc0900..8b93f92e 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/SessionInstructorMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/SessionInstructorMap.cs
@@ -69,23 +69,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.InstructorRole)
@@ -113,7 +112,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -121,7 +120,7 @@ public struct Table
public const string Name = "SessionInstructor";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/SessionMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/SessionMap.cs
index 7faa34ac..92b76219 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/SessionMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/SessionMap.cs
@@ -97,23 +97,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Group)
@@ -151,7 +150,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -159,7 +158,7 @@ public struct Table
public const string Name = "Session";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/SignUpMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/SignUpMap.cs
index fa6bce40..c3458276 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/SignUpMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/SignUpMap.cs
@@ -70,10 +70,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -86,7 +87,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -94,7 +95,7 @@ public struct Table
public const string Name = "SignUp";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/SignUpTopicMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/SignUpTopicMap.cs
index e915b7bd..6998a8f8 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/SignUpTopicMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/SignUpTopicMap.cs
@@ -65,10 +65,11 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
// relationships
@@ -86,7 +87,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -94,7 +95,7 @@ public struct Table
public const string Name = "SignUpTopic";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/TemplateMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/TemplateMap.cs
index a0c66914..5c692a9a 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/TemplateMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/TemplateMap.cs
@@ -81,23 +81,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Tenant)
@@ -115,7 +114,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -123,7 +122,7 @@ public struct Table
public const string Name = "Template";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/TenantMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/TenantMap.cs
index 3bda46dd..194cec99 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/TenantMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/TenantMap.cs
@@ -72,7 +72,8 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsDeleted)
.IsRequired()
.HasColumnName("IsDeleted")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.Created)
.IsRequired()
@@ -98,23 +99,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
#endregion
@@ -127,7 +127,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -135,7 +135,7 @@ public struct Table
public const string Name = "Tenant";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/TenantUserRoleMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/TenantUserRoleMap.cs
index ab9ab391..763c3547 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/TenantUserRoleMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/TenantUserRoleMap.cs
@@ -66,7 +66,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -74,7 +74,7 @@ public struct Table
public const string Name = "TenantUserRole";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/TopicInstructorMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/TopicInstructorMap.cs
index 524278f2..3f432443 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/TopicInstructorMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/TopicInstructorMap.cs
@@ -69,23 +69,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.InstructorRole)
@@ -108,7 +107,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -116,7 +115,7 @@ public struct Table
public const string Name = "TopicInstructor";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Mapping/TopicMap.cs b/service/src/InstructorIQ.Core/Data/Mapping/TopicMap.cs
index b3865d67..9c8f411f 100644
--- a/service/src/InstructorIQ.Core/Data/Mapping/TopicMap.cs
+++ b/service/src/InstructorIQ.Core/Data/Mapping/TopicMap.cs
@@ -66,12 +66,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.IsRequired)
.IsRequired()
.HasColumnName("IsRequired")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.IsPublished)
.IsRequired()
.HasColumnName("IsPublished")
- .HasColumnType("bit");
+ .HasColumnType("bit")
+ .HasDefaultValue(false);
builder.Property(t => t.InstructorSlots)
.HasColumnName("InstructorSlots")
@@ -111,23 +113,22 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.RowVersion)
.IsRequired()
+ .HasConversion()
.IsRowVersion()
+ .IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
- .HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodStart)
- .IsRequired()
.HasColumnName("PeriodStart")
.HasColumnType("datetime2")
- .HasDefaultValueSql("(sysutcdatetime())");
+ .ValueGeneratedOnAddOrUpdate();
builder.Property(t => t.PeriodEnd)
- .IsRequired()
.HasColumnName("PeriodEnd")
.HasColumnType("datetime2")
- .HasDefaultValueSql("('9999-12-31 23:59:59.9999999')");
+ .ValueGeneratedOnAddOrUpdate();
// relationships
builder.HasOne(t => t.Tenant)
@@ -150,7 +151,7 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
}
#region Generated Constants
- public struct Table
+ public readonly struct Table
{
/// Table Schema name constant for entity
public const string Schema = "IQ";
@@ -158,7 +159,7 @@ public struct Table
public const string Name = "Topic";
}
- public struct Columns
+ public readonly struct Columns
{
/// Column Name constant for property
public const string Id = "Id";
diff --git a/service/src/InstructorIQ.Core/Data/Queries/AttendanceExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/AttendanceExtensions.cs
index b1d4d03d..13442794 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/AttendanceExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/AttendanceExtensions.cs
@@ -19,8 +19,11 @@ public static partial class AttendanceExtensions
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByAttendeeEmail(this IQueryable queryable, string attendeeEmail)
+ public static System.Linq.IQueryable ByAttendeeEmail(this System.Linq.IQueryable queryable, string attendeeEmail)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.AttendeeEmail == attendeeEmail);
}
@@ -30,8 +33,11 @@ public static partial class AttendanceExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Attendance GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Attendance GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -43,14 +49,17 @@ public static InstructorIQ.Core.Data.Entities.Attendance GetByKey(this IQueryabl
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Attendance GetByKey(this IQueryabl
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable BySessionId(this IQueryable queryable, Guid sessionId)
+ public static System.Linq.IQueryable BySessionId(this System.Linq.IQueryable queryable, Guid sessionId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.SessionId == sessionId);
}
@@ -70,8 +82,11 @@ public static InstructorIQ.Core.Data.Entities.Attendance GetByKey(this IQueryabl
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/AuthenticationEventExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/AuthenticationEventExtensions.cs
index 27c787d5..01a409c7 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/AuthenticationEventExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/AuthenticationEventExtensions.cs
@@ -19,8 +19,11 @@ public static partial class AuthenticationEventExtensions
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByEmailAddress(this IQueryable queryable, string emailAddress)
+ public static System.Linq.IQueryable ByEmailAddress(this System.Linq.IQueryable queryable, string emailAddress)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.EmailAddress == emailAddress);
}
@@ -30,8 +33,11 @@ public static partial class AuthenticationEventExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.AuthenticationEvent GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.AuthenticationEvent GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -43,14 +49,17 @@ public static InstructorIQ.Core.Data.Entities.AuthenticationEvent GetByKey(this
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.AuthenticationEvent GetByKey(this
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByUserName(this IQueryable queryable, string userName)
+ public static System.Linq.IQueryable ByUserName(this System.Linq.IQueryable queryable, string userName)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.UserName == userName);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/DiscussionExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/DiscussionExtensions.cs
index 53f9f672..fd96f8f4 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/DiscussionExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/DiscussionExtensions.cs
@@ -19,8 +19,11 @@ public static partial class DiscussionExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Discussion GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Discussion GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Discussion GetByKey(this IQueryabl
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Discussion GetByKey(this IQueryabl
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Discussion GetByKey(this IQueryabl
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTopicId(this IQueryable queryable, Guid topicId)
+ public static System.Linq.IQueryable ByTopicId(this System.Linq.IQueryable queryable, Guid topicId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TopicId == topicId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/EmailDeliveryExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/EmailDeliveryExtensions.cs
index eebf6690..4b73ef82 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/EmailDeliveryExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/EmailDeliveryExtensions.cs
@@ -19,8 +19,11 @@ public static partial class EmailDeliveryExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.EmailDelivery GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.EmailDelivery GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.EmailDelivery GetByKey(this IQuery
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -50,24 +56,30 @@ public static InstructorIQ.Core.Data.Entities.EmailDelivery GetByKey(this IQuery
/// The value to filter by.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByIsProcessingIsDeliveredNextAttempt(this IQueryable queryable, bool isProcessing, bool isDelivered, DateTimeOffset? nextAttempt)
+ public static System.Linq.IQueryable ByIsProcessingIsDeliveredNextAttempt(this System.Linq.IQueryable queryable, bool isProcessing, bool isDelivered, DateTimeOffset? nextAttempt)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.IsProcessing == isProcessing
&& q.IsDelivered == isDelivered
&& (q.NextAttempt == nextAttempt || (nextAttempt == null && q.NextAttempt == null)));
- }
+ }
- ///
- /// Filters a sequence of values based on a predicate.
- ///
- /// An to filter.
- /// The value to filter by.
- /// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid? tenantId)
- {
- return queryable.Where(q => (q.TenantId == tenantId || (tenantId == null && q.TenantId == null)));
- }
+ ///
+ /// Filters a sequence of values based on a predicate.
+ ///
+ /// An to filter.
+ /// The value to filter by.
+ /// An that contains elements from the input sequence that satisfy the condition specified.
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid? tenantId)
+ {
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
+ return queryable.Where(q => (q.TenantId == tenantId || (tenantId == null && q.TenantId == null)));
+ }
- #endregion
+ #endregion
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/EmailTemplateExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/EmailTemplateExtensions.cs
index b39ba93c..e68c1d21 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/EmailTemplateExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/EmailTemplateExtensions.cs
@@ -19,8 +19,11 @@ public static partial class EmailTemplateExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQuery
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQuery
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQueryable queryable, string key)
+ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this System.Linq.IQueryable queryable, string key)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.FirstOrDefault(q => q.Key == key);
}
@@ -58,10 +67,14 @@ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQuery
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static Task GetByKeyAsync(this IQueryable queryable, string key)
+ public static async System.Threading.Tasks.Task GetByKeyAsync(this System.Linq.IQueryable queryable, string key, System.Threading.CancellationToken cancellationToken = default)
{
- return queryable.FirstOrDefaultAsync(q => q.Key == key);
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
+ return await queryable.FirstOrDefaultAsync(q => q.Key == key, cancellationToken);
}
///
@@ -70,8 +83,11 @@ public static InstructorIQ.Core.Data.Entities.EmailTemplate GetByKey(this IQuery
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid? tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid? tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.TenantId == tenantId || (tenantId == null && q.TenantId == null)));
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/GroupExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/GroupExtensions.cs
index 63e27d66..5527bd24 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/GroupExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/GroupExtensions.cs
@@ -19,8 +19,11 @@ public static partial class GroupExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Group GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Group GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Group GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Group GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByName(this IQueryable queryable, string name)
+ public static System.Linq.IQueryable ByName(this System.Linq.IQueryable queryable, string name)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Name == name);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Group GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/HistoryRecordExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/HistoryRecordExtensions.cs
index 2cd59c7f..f2fce7b6 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/HistoryRecordExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/HistoryRecordExtensions.cs
@@ -19,8 +19,11 @@ public static partial class HistoryRecordExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.HistoryRecord GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.HistoryRecord GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.HistoryRecord GetByKey(this IQuery
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -49,8 +55,11 @@ public static InstructorIQ.Core.Data.Entities.HistoryRecord GetByKey(this IQuery
/// The value to filter by.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByKeyEntity(this IQueryable queryable, Guid key, string entity)
+ public static System.Linq.IQueryable ByKeyEntity(this System.Linq.IQueryable queryable, Guid key, string entity)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Key == key
&& q.Entity == entity);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/ImportJobExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/ImportJobExtensions.cs
index c8e51640..f0be9918 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/ImportJobExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/ImportJobExtensions.cs
@@ -19,8 +19,11 @@ public static partial class ImportJobExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.ImportJob GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.ImportJob GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.ImportJob GetByKey(this IQueryable
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.ImportJob GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/InstructorRoleExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/InstructorRoleExtensions.cs
index 2b327d86..8fbd2525 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/InstructorRoleExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/InstructorRoleExtensions.cs
@@ -19,8 +19,11 @@ public static partial class InstructorRoleExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.InstructorRole GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.InstructorRole GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.InstructorRole GetByKey(this IQuer
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.InstructorRole GetByKey(this IQuer
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByName(this IQueryable queryable, string name)
+ public static System.Linq.IQueryable ByName(this System.Linq.IQueryable queryable, string name)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Name == name);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.InstructorRole GetByKey(this IQuer
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/LinkTokenExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/LinkTokenExtensions.cs
index 3554e472..e415ebb5 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/LinkTokenExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/LinkTokenExtensions.cs
@@ -19,8 +19,11 @@ public static partial class LinkTokenExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.LinkToken GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.LinkToken GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.LinkToken GetByKey(this IQueryable
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.LinkToken GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid? tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid? tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.TenantId == tenantId || (tenantId == null && q.TenantId == null)));
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.LinkToken GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.LinkToken GetByTokenHash(this IQueryable queryable, string tokenHash)
+ public static InstructorIQ.Core.Data.Entities.LinkToken GetByTokenHash(this System.Linq.IQueryable queryable, string tokenHash)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.FirstOrDefault(q => q.TokenHash == tokenHash);
}
@@ -69,10 +81,14 @@ public static InstructorIQ.Core.Data.Entities.LinkToken GetByTokenHash(this IQue
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static Task GetByTokenHashAsync(this IQueryable queryable, string tokenHash)
+ public static async System.Threading.Tasks.Task GetByTokenHashAsync(this System.Linq.IQueryable queryable, string tokenHash, System.Threading.CancellationToken cancellationToken = default)
{
- return queryable.FirstOrDefaultAsync(q => q.TokenHash == tokenHash);
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
+ return await queryable.FirstOrDefaultAsync(q => q.TokenHash == tokenHash, cancellationToken);
}
///
@@ -81,8 +97,11 @@ public static InstructorIQ.Core.Data.Entities.LinkToken GetByTokenHash(this IQue
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByUserName(this IQueryable queryable, string userName)
+ public static System.Linq.IQueryable ByUserName(this System.Linq.IQueryable queryable, string userName)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.UserName == userName);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/LocationExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/LocationExtensions.cs
index cedd888d..6f541d42 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/LocationExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/LocationExtensions.cs
@@ -19,8 +19,11 @@ public static partial class LocationExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Location GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Location GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Location GetByKey(this IQueryable<
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Location GetByKey(this IQueryable<
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByName(this IQueryable queryable, string name)
+ public static System.Linq.IQueryable ByName(this System.Linq.IQueryable queryable, string name)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Name == name);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Location GetByKey(this IQueryable<
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/NotificationExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/NotificationExtensions.cs
index 0d1112cb..6188a217 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/NotificationExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/NotificationExtensions.cs
@@ -19,8 +19,11 @@ public static partial class NotificationExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Notification GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Notification GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Notification GetByKey(this IQuerya
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Notification GetByKey(this IQuerya
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Notification GetByKey(this IQuerya
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByUserName(this IQueryable queryable, string userName)
+ public static System.Linq.IQueryable ByUserName(this System.Linq.IQueryable queryable, string userName)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.UserName == userName);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/RefreshTokenExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/RefreshTokenExtensions.cs
index 557bb29d..cabcae83 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/RefreshTokenExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/RefreshTokenExtensions.cs
@@ -19,8 +19,11 @@ public static partial class RefreshTokenExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.RefreshToken GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByKey(this IQuerya
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByKey(this IQuerya
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.RefreshToken GetByTokenHash(this IQueryable queryable, string tokenHash)
+ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByTokenHash(this System.Linq.IQueryable queryable, string tokenHash)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.FirstOrDefault(q => q.TokenHash == tokenHash);
}
@@ -58,10 +67,14 @@ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByTokenHash(this I
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static Task GetByTokenHashAsync(this IQueryable queryable, string tokenHash)
+ public static async System.Threading.Tasks.Task GetByTokenHashAsync(this System.Linq.IQueryable queryable, string tokenHash, System.Threading.CancellationToken cancellationToken = default)
{
- return queryable.FirstOrDefaultAsync(q => q.TokenHash == tokenHash);
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
+ return await queryable.FirstOrDefaultAsync(q => q.TokenHash == tokenHash, cancellationToken);
}
///
@@ -70,8 +83,11 @@ public static InstructorIQ.Core.Data.Entities.RefreshToken GetByTokenHash(this I
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByUserName(this IQueryable queryable, string userName)
+ public static System.Linq.IQueryable ByUserName(this System.Linq.IQueryable queryable, string userName)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.UserName == userName);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/SessionExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/SessionExtensions.cs
index ac7df543..68a3829f 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/SessionExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/SessionExtensions.cs
@@ -19,8 +19,11 @@ public static partial class SessionExtensions
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByGroupId(this IQueryable queryable, Guid? groupId)
+ public static System.Linq.IQueryable ByGroupId(this System.Linq.IQueryable queryable, Guid? groupId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.GroupId == groupId || (groupId == null && q.GroupId == null)));
}
@@ -30,8 +33,11 @@ public static partial class SessionExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -43,14 +49,17 @@ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByLocationId(this IQueryable queryable, Guid? locationId)
+ public static System.Linq.IQueryable ByLocationId(this System.Linq.IQueryable queryable, Guid? locationId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.LocationId == locationId || (locationId == null && q.LocationId == null)));
}
@@ -70,8 +82,11 @@ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByStartDate(this IQueryable queryable, DateTime? startDate)
+ public static System.Linq.IQueryable ByStartDate(this System.Linq.IQueryable queryable, DateOnly? startDate)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.StartDate == startDate || (startDate == null && q.StartDate == null)));
}
@@ -81,8 +96,11 @@ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
@@ -92,8 +110,11 @@ public static InstructorIQ.Core.Data.Entities.Session GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTopicId(this IQueryable queryable, Guid topicId)
+ public static System.Linq.IQueryable ByTopicId(this System.Linq.IQueryable queryable, Guid topicId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TopicId == topicId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/SessionInstructorExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/SessionInstructorExtensions.cs
index 828657da..3459f335 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/SessionInstructorExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/SessionInstructorExtensions.cs
@@ -19,8 +19,11 @@ public static partial class SessionInstructorExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this IQ
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this IQ
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByInstructorRoleId(this IQueryable queryable, Guid? instructorRoleId)
+ public static System.Linq.IQueryable ByInstructorRoleId(this System.Linq.IQueryable queryable, Guid? instructorRoleId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => (q.InstructorRoleId == instructorRoleId || (instructorRoleId == null && q.InstructorRoleId == null)));
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this IQ
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable BySessionId(this IQueryable queryable, Guid sessionId)
+ public static System.Linq.IQueryable BySessionId(this System.Linq.IQueryable queryable, Guid sessionId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.SessionId == sessionId);
}
@@ -72,13 +84,16 @@ public static InstructorIQ.Core.Data.Entities.SessionInstructor GetByKey(this IQ
/// The value to filter by.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable BySessionIdInstructorIdInstructorRoleId(this IQueryable queryable, Guid sessionId, Guid instructorId, Guid? instructorRoleId)
+ public static System.Linq.IQueryable BySessionIdInstructorIdInstructorRoleId(this System.Linq.IQueryable queryable, Guid sessionId, Guid instructorId, Guid? instructorRoleId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.SessionId == sessionId
&& q.InstructorId == instructorId
&& (q.InstructorRoleId == instructorRoleId || (instructorRoleId == null && q.InstructorRoleId == null)));
- }
+ }
- #endregion
+ #endregion
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/SignUpExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/SignUpExtensions.cs
index 20391314..745db98b 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/SignUpExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/SignUpExtensions.cs
@@ -19,8 +19,11 @@ public static partial class SignUpExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.SignUp GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.SignUp GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.SignUp GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.SignUp GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/SignUpTopicExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/SignUpTopicExtensions.cs
index ff475d5f..ecbd7e53 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/SignUpTopicExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/SignUpTopicExtensions.cs
@@ -19,8 +19,11 @@ public static partial class SignUpTopicExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.SignUpTopic GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.SignUpTopic GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.SignUpTopic GetByKey(this IQueryab
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.SignUpTopic GetByKey(this IQueryab
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable BySignUpId(this IQueryable queryable, Guid signUpId)
+ public static System.Linq.IQueryable BySignUpId(this System.Linq.IQueryable queryable, Guid signUpId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.SignUpId == signUpId);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.SignUpTopic GetByKey(this IQueryab
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTopicId(this IQueryable queryable, Guid topicId)
+ public static System.Linq.IQueryable ByTopicId(this System.Linq.IQueryable queryable, Guid topicId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TopicId == topicId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/TemplateExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/TemplateExtensions.cs
index 379ce217..8907bc76 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/TemplateExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/TemplateExtensions.cs
@@ -19,8 +19,11 @@ public static partial class TemplateExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Template GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Template GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Template GetByKey(this IQueryable<
///
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Template GetByKey(this IQueryable<
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByName(this IQueryable queryable, string name)
+ public static System.Linq.IQueryable ByName(this System.Linq.IQueryable queryable, string name)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Name == name);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Template GetByKey(this IQueryable<
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTemplateType(this IQueryable queryable, string templateType)
+ public static System.Linq.IQueryable ByTemplateType(this System.Linq.IQueryable queryable, string templateType)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TemplateType == templateType);
}
@@ -70,8 +82,11 @@ public static InstructorIQ.Core.Data.Entities.Template GetByKey(this IQueryable<
/// An to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByTenantId(this IQueryable queryable, Guid tenantId)
+ public static System.Linq.IQueryable ByTenantId(this System.Linq.IQueryable queryable, Guid tenantId)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.TenantId == tenantId);
}
diff --git a/service/src/InstructorIQ.Core/Data/Queries/TenantExtensions.cs b/service/src/InstructorIQ.Core/Data/Queries/TenantExtensions.cs
index 7564a064..d247b2a4 100644
--- a/service/src/InstructorIQ.Core/Data/Queries/TenantExtensions.cs
+++ b/service/src/InstructorIQ.Core/Data/Queries/TenantExtensions.cs
@@ -19,8 +19,11 @@ public static partial class TenantExtensions
/// An to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this IQueryable queryable, Guid id)
+ public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this System.Linq.IQueryable queryable, Guid id)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
return dbSet.Find(id);
@@ -32,14 +35,17 @@ public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this IQueryable
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of or null if not found.
- public static ValueTask GetByKeyAsync(this IQueryable queryable, Guid id)
+ public static async System.Threading.Tasks.ValueTask GetByKeyAsync(this System.Linq.IQueryable queryable, Guid id, System.Threading.CancellationToken cancellationToken = default)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
if (queryable is DbSet dbSet)
- return dbSet.FindAsync(id);
+ return await dbSet.FindAsync(new object[] { id }, cancellationToken);
- var task = queryable.FirstOrDefaultAsync(q => q.Id == id);
- return new ValueTask(task);
+ return await queryable.FirstOrDefaultAsync(q => q.Id == id, cancellationToken);
}
///
@@ -48,8 +54,11 @@ public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByIsDeleted(this IQueryable queryable, bool isDeleted)
+ public static System.Linq.IQueryable ByIsDeleted(this System.Linq.IQueryable queryable, bool isDeleted)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.IsDeleted == isDeleted);
}
@@ -59,8 +68,11 @@ public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An that contains elements from the input sequence that satisfy the condition specified.
- public static IQueryable ByName(this IQueryable queryable, string name)
+ public static System.Linq.IQueryable ByName(this System.Linq.IQueryable queryable, string name)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.Where(q => q.Name == name);
}
@@ -70,8 +82,11 @@ public static InstructorIQ.Core.Data.Entities.Tenant GetByKey(this IQueryableAn to filter.
/// The value to filter by.
/// An instance of or null if not found.
- public static InstructorIQ.Core.Data.Entities.Tenant GetBySlug(this IQueryable queryable, string slug)
+ public static InstructorIQ.Core.Data.Entities.Tenant GetBySlug(this System.Linq.IQueryable queryable, string slug)
{
+ if (queryable is null)
+ throw new ArgumentNullException(nameof(queryable));
+
return queryable.FirstOrDefault(q => q.Slug == slug);
}
@@ -80,10 +95,14 @@ public static InstructorIQ.Core.Data.Entities.Tenant GetBySlug(this IQueryable
/// An to filter.
/// The value to filter by.
+ /// A to observe while waiting for the task to complete.
/// An instance of