8 changed files with 6 additions and 84 deletions
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
using Bit.Core.Entities.Provider; |
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries; |
||||
|
||||
public class ProviderOrganizationCountByOrganizationIdsQuery : IQuery<ProviderOrganization> |
||||
{ |
||||
private readonly IEnumerable<Guid> _organizationIds; |
||||
|
||||
public ProviderOrganizationCountByOrganizationIdsQuery(IEnumerable<Guid> organizationIds) |
||||
{ |
||||
_organizationIds = organizationIds; |
||||
} |
||||
|
||||
public IQueryable<ProviderOrganization> Run(DatabaseContext dbContext) |
||||
{ |
||||
var query = from po in dbContext.ProviderOrganizations |
||||
where _organizationIds.Contains(po.OrganizationId) |
||||
select po; |
||||
return query; |
||||
} |
||||
} |
||||
@ -1,18 +0,0 @@
@@ -1,18 +0,0 @@
|
||||
CREATE PROCEDURE [dbo].[ProviderOrganization_ReadCountByOrganizationIds] |
||||
@Ids AS [dbo].[GuidIdArray] READONLY |
||||
AS |
||||
BEGIN |
||||
SET NOCOUNT ON |
||||
|
||||
IF (SELECT COUNT(1) FROM @Ids) < 1 |
||||
BEGIN |
||||
RETURN(-1) |
||||
END |
||||
|
||||
SELECT |
||||
COUNT(1) |
||||
FROM |
||||
[dbo].[ProviderOrganizationView] |
||||
WHERE |
||||
[OrganizationId] IN (SELECT [Id] FROM @Ids) |
||||
END |
||||
Loading…
Reference in new issue