using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = client.Projects.Get("movieDb");
// Get the role by id
var role = project.Security.Roles.Get("fb2f4753-7b4c-4885-b7fe-905377af95ff");
Get by Guid id
CSHARP
1
2
3
public Role Get(Guid roleId)
{
}
Example
CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = client.Projects.Get("movieDb");
// The role id may have been passed in as Guid variable
var roleId = Guid.Parse("fb2f4753-7b4c-4885-b7fe-905377af95ff");
// Get the role by id
var role = project.Security.Roles.Get(roleId);
Get by string id async
CSHARP
1
2
3
public async Task<Role> GetAsync(string roleId)
{
}
Example
CSHARP
1
2
3
4
5
6
7
8
9
using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = await client.Projects.GetAsync("movieDb");
// Get the role by id
var role = await project.Security.Roles.GetAsync("fb2f4753-7b4c-4885-b7fe-905377af95ff");
Get by Guid id async
CSHARP
1
2
3
public async Task<Role> GetAsync(Guid roleId)
{
}
Example
CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
using Zengenti.Contensis.Management;
var client = ManagementClient.Create();
// Access the movie DB project
var project = await client.Projects.GetAsync("movieDb");
// The role id may have been passed in as a Guid variable
var roleId = Guid.Parse("fb2f4753-7b4c-4885-b7fe-905377af95ff");
// Get the role by id
var role = await project.Security.Roles.GetAsync(roleId);