mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 09:02:48 -05:00
Split out repositories to Infrastructure.Dapper / EntityFramework (#1759)
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Bit.Infrastructure.EntityFramework.Models;
|
||||
|
||||
namespace Bit.Infrastructure.EntityFramework.Repositories.Queries
|
||||
{
|
||||
public class CollectionReadCountByOrganizationIdQuery : IQuery<Collection>
|
||||
{
|
||||
private readonly Guid _organizationId;
|
||||
|
||||
public CollectionReadCountByOrganizationIdQuery(Guid organizationId)
|
||||
{
|
||||
_organizationId = organizationId;
|
||||
}
|
||||
|
||||
public IQueryable<Collection> Run(DatabaseContext dbContext)
|
||||
{
|
||||
var query = from c in dbContext.Collections
|
||||
where c.OrganizationId == _organizationId
|
||||
select c;
|
||||
return query;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user