From c37f4b45a77e367df63ea3d5963ab27a637f5356 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:47:21 -0400 Subject: [PATCH] Make AC Repos Nullable (#4610) --- .../Repositories/IGroupRepository.cs | 4 ++- .../Repositories/IOrganizationRepository.cs | 8 +++-- .../IOrganizationUserRepository.cs | 16 +++++---- .../Repositories/IPolicyRepository.cs | 4 ++- .../IProviderOrganizationRepository.cs | 6 ++-- .../Repositories/IProviderRepository.cs | 4 ++- .../Repositories/IProviderUserRepository.cs | 4 ++- .../Helpers/OrganizationUserHelpers.cs | 4 ++- .../Repositories/GroupRepository.cs | 10 +++--- .../Repositories/OrganizationRepository.cs | 14 ++++---- .../OrganizationUserRepository.cs | 34 +++++++++---------- .../Repositories/PolicyRepository.cs | 4 ++- .../ProviderOrganizationRepository.cs | 6 ++-- .../Repositories/ProviderRepository.cs | 4 ++- .../Repositories/ProviderUserRepository.cs | 4 ++- 15 files changed, 74 insertions(+), 52 deletions(-) diff --git a/src/Core/AdminConsole/Repositories/IGroupRepository.cs b/src/Core/AdminConsole/Repositories/IGroupRepository.cs index 7e691db17..6519b1983 100644 --- a/src/Core/AdminConsole/Repositories/IGroupRepository.cs +++ b/src/Core/AdminConsole/Repositories/IGroupRepository.cs @@ -2,11 +2,13 @@ using Bit.Core.Models.Data; using Bit.Core.Repositories; +#nullable enable + namespace Bit.Core.AdminConsole.Repositories; public interface IGroupRepository : IRepository { - Task>> GetByIdWithCollectionsAsync(Guid id); + Task>> GetByIdWithCollectionsAsync(Guid id); Task> GetManyByOrganizationIdAsync(Guid organizationId); Task>>> GetManyWithCollectionsByOrganizationIdAsync( Guid organizationId); diff --git a/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs b/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs index 4598a11fb..d6ab24072 100644 --- a/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs +++ b/src/Core/AdminConsole/Repositories/IOrganizationRepository.cs @@ -1,18 +1,20 @@ using Bit.Core.AdminConsole.Entities; using Bit.Core.Models.Data.Organizations; +#nullable enable + namespace Bit.Core.Repositories; public interface IOrganizationRepository : IRepository { - Task GetByIdentifierAsync(string identifier); + Task GetByIdentifierAsync(string identifier); Task> GetManyByEnabledAsync(); Task> GetManyByUserIdAsync(Guid userId); Task> SearchAsync(string name, string userEmail, bool? paid, int skip, int take); Task UpdateStorageAsync(Guid id); Task> GetManyAbilitiesAsync(); - Task GetByLicenseKeyAsync(string licenseKey); - Task GetSelfHostedOrganizationDetailsById(Guid id); + Task GetByLicenseKeyAsync(string licenseKey); + Task GetSelfHostedOrganizationDetailsById(Guid id); Task> SearchUnassignedToProviderAsync(string name, string ownerEmail, int skip, int take); Task> GetOwnerEmailAddressesById(Guid organizationId); } diff --git a/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs b/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs index c8bf3a56c..7d115c6b8 100644 --- a/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs +++ b/src/Core/AdminConsole/Repositories/IOrganizationUserRepository.cs @@ -5,6 +5,8 @@ using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Data.Organizations.OrganizationUsers; +#nullable enable + namespace Bit.Core.Repositories; public interface IOrganizationUserRepository : IRepository @@ -17,26 +19,26 @@ public interface IOrganizationUserRepository : IRepository GetCountByOrganizationAsync(Guid organizationId, string email, bool onlyRegisteredUsers); Task GetOccupiedSeatCountByOrganizationIdAsync(Guid organizationId); Task> SelectKnownEmailsAsync(Guid organizationId, IEnumerable emails, bool onlyRegisteredUsers); - Task GetByOrganizationAsync(Guid organizationId, Guid userId); - Task>> GetByIdWithCollectionsAsync(Guid id); - Task GetDetailsByIdAsync(Guid id); - Task>> + Task GetByOrganizationAsync(Guid organizationId, Guid userId); + Task>> GetByIdWithCollectionsAsync(Guid id); + Task GetDetailsByIdAsync(Guid id); + Task>> GetDetailsByIdWithCollectionsAsync(Guid id); Task> GetManyDetailsByOrganizationAsync(Guid organizationId, bool includeGroups = false, bool includeCollections = false); Task> GetManyDetailsByUserAsync(Guid userId, OrganizationUserStatusType? status = null); - Task GetDetailsByUserAsync(Guid userId, Guid organizationId, + Task GetDetailsByUserAsync(Guid userId, Guid organizationId, OrganizationUserStatusType? status = null); Task UpdateGroupsAsync(Guid orgUserId, IEnumerable groupIds); Task UpsertManyAsync(IEnumerable organizationUsers); Task CreateAsync(OrganizationUser obj, IEnumerable collections); - Task> CreateManyAsync(IEnumerable organizationIdUsers); + Task?> CreateManyAsync(IEnumerable organizationIdUsers); Task ReplaceAsync(OrganizationUser obj, IEnumerable collections); Task ReplaceManyAsync(IEnumerable organizationUsers); Task> GetManyByManyUsersAsync(IEnumerable userIds); Task> GetManyAsync(IEnumerable Ids); Task DeleteManyAsync(IEnumerable userIds); - Task GetByOrganizationEmailAsync(Guid organizationId, string email); + Task GetByOrganizationEmailAsync(Guid organizationId, string email); Task> GetManyPublicKeysByOrganizationUserAsync(Guid organizationId, IEnumerable Ids); Task> GetManyByMinimumRoleAsync(Guid organizationId, OrganizationUserType minRole); Task RevokeAsync(Guid id); diff --git a/src/Core/AdminConsole/Repositories/IPolicyRepository.cs b/src/Core/AdminConsole/Repositories/IPolicyRepository.cs index 6050a7f69..ad0654dd3 100644 --- a/src/Core/AdminConsole/Repositories/IPolicyRepository.cs +++ b/src/Core/AdminConsole/Repositories/IPolicyRepository.cs @@ -2,11 +2,13 @@ using Bit.Core.AdminConsole.Enums; using Bit.Core.Repositories; +#nullable enable + namespace Bit.Core.AdminConsole.Repositories; public interface IPolicyRepository : IRepository { - Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type); + Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type); Task> GetManyByOrganizationIdAsync(Guid organizationId); Task> GetManyByUserIdAsync(Guid userId); } diff --git a/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs b/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs index 6f267295e..12a1a874b 100644 --- a/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderOrganizationRepository.cs @@ -2,13 +2,15 @@ using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Repositories; +#nullable enable + namespace Bit.Core.AdminConsole.Repositories; public interface IProviderOrganizationRepository : IRepository { - Task> CreateManyAsync(IEnumerable providerOrganizations); + Task?> CreateManyAsync(IEnumerable providerOrganizations); Task> GetManyDetailsByProviderAsync(Guid providerId); - Task GetByOrganizationId(Guid organizationId); + Task GetByOrganizationId(Guid organizationId); Task> GetManyByUserAsync(Guid userId); Task GetCountByOrganizationIdsAsync(IEnumerable organizationIds); } diff --git a/src/Core/AdminConsole/Repositories/IProviderRepository.cs b/src/Core/AdminConsole/Repositories/IProviderRepository.cs index c9da0b2fa..434a59d5c 100644 --- a/src/Core/AdminConsole/Repositories/IProviderRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderRepository.cs @@ -2,11 +2,13 @@ using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Repositories; +#nullable enable + namespace Bit.Core.AdminConsole.Repositories; public interface IProviderRepository : IRepository { - Task GetByOrganizationIdAsync(Guid organizationId); + Task GetByOrganizationIdAsync(Guid organizationId); Task> SearchAsync(string name, string userEmail, int skip, int take); Task> GetManyAbilitiesAsync(); } diff --git a/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs b/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs index 34443f7d5..7bc412577 100644 --- a/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs +++ b/src/Core/AdminConsole/Repositories/IProviderUserRepository.cs @@ -3,6 +3,8 @@ using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.AdminConsole.Models.Data.Provider; using Bit.Core.Repositories; +#nullable enable + namespace Bit.Core.AdminConsole.Repositories; public interface IProviderUserRepository : IRepository @@ -10,7 +12,7 @@ public interface IProviderUserRepository : IRepository Task GetCountByProviderAsync(Guid providerId, string email, bool onlyRegisteredUsers); Task> GetManyAsync(IEnumerable ids); Task> GetManyByUserAsync(Guid userId); - Task GetByProviderUserAsync(Guid providerId, Guid userId); + Task GetByProviderUserAsync(Guid providerId, Guid userId); Task> GetManyByProviderAsync(Guid providerId, ProviderUserType? type = null); Task> GetManyDetailsByProviderAsync(Guid providerId, ProviderUserStatusType? status = null); Task> GetManyDetailsByUserAsync(Guid userId, diff --git a/src/Infrastructure.Dapper/AdminConsole/Helpers/OrganizationUserHelpers.cs b/src/Infrastructure.Dapper/AdminConsole/Helpers/OrganizationUserHelpers.cs index fac7f6f09..dadbdb06d 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Helpers/OrganizationUserHelpers.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Helpers/OrganizationUserHelpers.cs @@ -2,6 +2,8 @@ using Bit.Core.Entities; using Dapper; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Helpers; public static class OrganizationUserHelpers @@ -11,7 +13,7 @@ public static class OrganizationUserHelpers var table = new DataTable(); table.SetTypeName("[dbo].[OrganizationUserType2]"); - var columnData = new List<(string name, Type type, Func getter)> + var columnData = new List<(string name, Type type, Func getter)> { (nameof(OrganizationUser.Id), typeof(Guid), ou => ou.Id), (nameof(OrganizationUser.OrganizationId), typeof(Guid), ou => ou.OrganizationId), diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/GroupRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/GroupRepository.cs index 13c0bc5bf..d8245ce71 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/GroupRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/GroupRepository.cs @@ -10,6 +10,8 @@ using Bit.Infrastructure.Dapper.Repositories; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Repositories; public class GroupRepository : Repository, IGroupRepository @@ -22,7 +24,7 @@ public class GroupRepository : Repository, IGroupRepository : base(connectionString, readOnlyConnectionString) { } - public async Task>> GetByIdWithCollectionsAsync(Guid id) + public async Task>> GetByIdWithCollectionsAsync(Guid id) { using (var connection = new SqlConnection(ConnectionString)) { @@ -34,7 +36,7 @@ public class GroupRepository : Repository, IGroupRepository var group = await results.ReadFirstOrDefaultAsync(); var colletions = (await results.ReadAsync()).ToList(); - return new Tuple>(group, colletions); + return new Tuple>(group, colletions); } } @@ -136,7 +138,7 @@ public class GroupRepository : Repository, IGroupRepository public async Task CreateAsync(Group obj, IEnumerable collections) { obj.SetNewId(); - var objWithCollections = JsonSerializer.Deserialize(JsonSerializer.Serialize(obj)); + var objWithCollections = JsonSerializer.Deserialize(JsonSerializer.Serialize(obj))!; objWithCollections.Collections = collections.ToArrayTVP(); using (var connection = new SqlConnection(ConnectionString)) @@ -150,7 +152,7 @@ public class GroupRepository : Repository, IGroupRepository public async Task ReplaceAsync(Group obj, IEnumerable collections) { - var objWithCollections = JsonSerializer.Deserialize(JsonSerializer.Serialize(obj)); + var objWithCollections = JsonSerializer.Deserialize(JsonSerializer.Serialize(obj))!; objWithCollections.Collections = collections.ToArrayTVP(); using (var connection = new SqlConnection(ConnectionString)) diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationRepository.cs index f4c771ade..704bb85f9 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationRepository.cs @@ -9,6 +9,8 @@ using Dapper; using Microsoft.Data.SqlClient; using Microsoft.Extensions.Logging; +#nullable enable + namespace Bit.Infrastructure.Dapper.Repositories; public class OrganizationRepository : Repository, IOrganizationRepository @@ -18,16 +20,12 @@ public class OrganizationRepository : Repository, IOrganizat public OrganizationRepository( GlobalSettings globalSettings, ILogger logger) - : this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString) + : base(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString) { _logger = logger; } - public OrganizationRepository(string connectionString, string readOnlyConnectionString) - : base(connectionString, readOnlyConnectionString) - { } - - public async Task GetByIdentifierAsync(string identifier) + public async Task GetByIdentifierAsync(string identifier) { using (var connection = new SqlConnection(ConnectionString)) { @@ -104,7 +102,7 @@ public class OrganizationRepository : Repository, IOrganizat } } - public async Task GetByLicenseKeyAsync(string licenseKey) + public async Task GetByLicenseKeyAsync(string licenseKey) { using (var connection = new SqlConnection(ConnectionString)) { @@ -117,7 +115,7 @@ public class OrganizationRepository : Repository, IOrganizat } } - public async Task GetSelfHostedOrganizationDetailsById(Guid id) + public async Task GetSelfHostedOrganizationDetailsById(Guid id) { using (var connection = new SqlConnection(ConnectionString)) { diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationUserRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationUserRepository.cs index 41ea477b6..92cee7645 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationUserRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/OrganizationUserRepository.cs @@ -13,6 +13,8 @@ using Bit.Infrastructure.Dapper.AdminConsole.Helpers; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.Repositories; public class OrganizationUserRepository : Repository, IOrganizationUserRepository @@ -25,7 +27,7 @@ public class OrganizationUserRepository : Repository, IO private string _marsConnectionString; public OrganizationUserRepository(GlobalSettings globalSettings) - : this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString) + : base(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString) { var builder = new SqlConnectionStringBuilder(ConnectionString) { @@ -34,10 +36,6 @@ public class OrganizationUserRepository : Repository, IO _marsConnectionString = builder.ToString(); } - public OrganizationUserRepository(string connectionString, string readOnlyConnectionString) - : base(connectionString, readOnlyConnectionString) - { } - public async Task GetCountByOrganizationIdAsync(Guid organizationId) { using (var connection = new SqlConnection(ConnectionString)) @@ -132,7 +130,7 @@ public class OrganizationUserRepository : Repository, IO } } - public async Task GetByOrganizationAsync(Guid organizationId, Guid userId) + public async Task GetByOrganizationAsync(Guid organizationId, Guid userId) { using (var connection = new SqlConnection(ConnectionString)) { @@ -172,7 +170,7 @@ public class OrganizationUserRepository : Repository, IO } } - public async Task>> GetByIdWithCollectionsAsync(Guid id) + public async Task>> GetByIdWithCollectionsAsync(Guid id) { using (var connection = new SqlConnection(ConnectionString)) { @@ -183,11 +181,11 @@ public class OrganizationUserRepository : Repository, IO var user = (await results.ReadAsync()).SingleOrDefault(); var collections = (await results.ReadAsync()).ToList(); - return new Tuple>(user, collections); + return new Tuple>(user, collections); } } - public async Task GetDetailsByIdAsync(Guid id) + public async Task GetDetailsByIdAsync(Guid id) { using (var connection = new SqlConnection(ConnectionString)) { @@ -199,7 +197,7 @@ public class OrganizationUserRepository : Repository, IO return results.SingleOrDefault(); } } - public async Task>> + public async Task>> GetDetailsByIdWithCollectionsAsync(Guid id) { using (var connection = new SqlConnection(ConnectionString)) @@ -211,7 +209,7 @@ public class OrganizationUserRepository : Repository, IO var user = (await results.ReadAsync()).SingleOrDefault(); var collections = (await results.ReadAsync()).ToList(); - return new Tuple>(user, collections); + return new Tuple>(user, collections); } } @@ -224,8 +222,8 @@ public class OrganizationUserRepository : Repository, IO new { OrganizationId = organizationId }, commandType: CommandType.StoredProcedure); - List> userGroups = null; - List> userCollections = null; + List>? userGroups = null; + List>? userCollections = null; var users = results.ToList(); @@ -294,7 +292,7 @@ public class OrganizationUserRepository : Repository, IO } } - public async Task GetDetailsByUserAsync(Guid userId, + public async Task GetDetailsByUserAsync(Guid userId, Guid organizationId, OrganizationUserStatusType? status = null) { using (var connection = new SqlConnection(ConnectionString)) @@ -323,7 +321,7 @@ public class OrganizationUserRepository : Repository, IO { obj.SetNewId(); var objWithCollections = JsonSerializer.Deserialize( - JsonSerializer.Serialize(obj)); + JsonSerializer.Serialize(obj))!; objWithCollections.Collections = collections.ToArrayTVP(); using (var connection = new SqlConnection(ConnectionString)) @@ -340,7 +338,7 @@ public class OrganizationUserRepository : Repository, IO public async Task ReplaceAsync(OrganizationUser obj, IEnumerable collections) { var objWithCollections = JsonSerializer.Deserialize( - JsonSerializer.Serialize(obj)); + JsonSerializer.Serialize(obj))!; objWithCollections.Collections = collections.ToArrayTVP(); using (var connection = new SqlConnection(ConnectionString)) @@ -378,7 +376,7 @@ public class OrganizationUserRepository : Repository, IO } } - public async Task GetByOrganizationEmailAsync(Guid organizationId, string email) + public async Task GetByOrganizationEmailAsync(Guid organizationId, string email) { using (var connection = new SqlConnection(ConnectionString)) { @@ -420,7 +418,7 @@ public class OrganizationUserRepository : Repository, IO await ReplaceManyAsync(replaceUsers); } - public async Task> CreateManyAsync(IEnumerable organizationUsers) + public async Task?> CreateManyAsync(IEnumerable organizationUsers) { if (!organizationUsers.Any()) { diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/PolicyRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/PolicyRepository.cs index 1a59c501a..196f3e373 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/PolicyRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/PolicyRepository.cs @@ -7,6 +7,8 @@ using Bit.Infrastructure.Dapper.Repositories; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Repositories; public class PolicyRepository : Repository, IPolicyRepository @@ -19,7 +21,7 @@ public class PolicyRepository : Repository, IPolicyRepository : base(connectionString, readOnlyConnectionString) { } - public async Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type) + public async Task GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type) { using (var connection = new SqlConnection(ConnectionString)) { diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderOrganizationRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderOrganizationRepository.cs index 66b4ad856..348dee79b 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderOrganizationRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderOrganizationRepository.cs @@ -7,6 +7,8 @@ using Bit.Infrastructure.Dapper.Repositories; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Repositories; public class ProviderOrganizationRepository : Repository, IProviderOrganizationRepository @@ -19,7 +21,7 @@ public class ProviderOrganizationRepository : Repository> CreateManyAsync(IEnumerable providerOrganizations) + public async Task?> CreateManyAsync(IEnumerable providerOrganizations) { var entities = providerOrganizations.ToList(); @@ -74,7 +76,7 @@ public class ProviderOrganizationRepository : Repository GetByOrganizationId(Guid organizationId) + public async Task GetByOrganizationId(Guid organizationId) { using (var connection = new SqlConnection(ConnectionString)) { diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderRepository.cs index 812ed30ff..6926e0933 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderRepository.cs @@ -7,6 +7,8 @@ using Bit.Infrastructure.Dapper.Repositories; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Repositories; public class ProviderRepository : Repository, IProviderRepository @@ -19,7 +21,7 @@ public class ProviderRepository : Repository, IProviderRepositor : base(connectionString, readOnlyConnectionString) { } - public async Task GetByOrganizationIdAsync(Guid organizationId) + public async Task GetByOrganizationIdAsync(Guid organizationId) { using (var connection = new SqlConnection(ConnectionString)) { diff --git a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderUserRepository.cs b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderUserRepository.cs index dafa78a07..467857612 100644 --- a/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderUserRepository.cs +++ b/src/Infrastructure.Dapper/AdminConsole/Repositories/ProviderUserRepository.cs @@ -8,6 +8,8 @@ using Bit.Infrastructure.Dapper.Repositories; using Dapper; using Microsoft.Data.SqlClient; +#nullable enable + namespace Bit.Infrastructure.Dapper.AdminConsole.Repositories; public class ProviderUserRepository : Repository, IProviderUserRepository @@ -59,7 +61,7 @@ public class ProviderUserRepository : Repository, IProviderU } } - public async Task GetByProviderUserAsync(Guid providerId, Guid userId) + public async Task GetByProviderUserAsync(Guid providerId, Guid userId) { using (var connection = new SqlConnection(ConnectionString)) {