1
0
mirror of https://github.com/bitwarden/server synced 2025-12-30 15:14:02 +00:00

leave org apis

This commit is contained in:
Kyle Spearrin
2017-04-12 10:07:27 -04:00
parent 7afa3f5d1b
commit 1cf38397f3
7 changed files with 61 additions and 0 deletions

View File

@@ -60,6 +60,19 @@ namespace Bit.Core.Repositories.SqlServer
}
}
public async Task<OrganizationUser> GetByOrganizationAsync(Guid organizationId, Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<OrganizationUser>(
"[dbo].[OrganizationUser_ReadByOrganizationIdUserId]",
new { OrganizationId = organizationId, UserId = userId },
commandType: CommandType.StoredProcedure);
return results.SingleOrDefault();
}
}
public async Task<ICollection<OrganizationUser>> GetManyByUserAsync(Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))