Hi,
this should be help you:
using System.Linq;
using NetSqlAzMan;
using NetSqlAzMan.Interfaces;
namespace NetSqlAzManDemo
{
class
Program
{
static
void Main(string[]
args)
{
string
sqlConnectionString = "data source=(local);Initial Catalog=NetSqlAzManStorage;Integrated Security=SSPI";
using (IAzManStorage
storage = new
SqlAzManStorage(sqlConnectionString))
{
storage.OpenConnection();
IAzManStore store = storage.GetStore("My
Store");
IAzManApplication application
= store.GetApplication("My Application");
//1. to get a list of operations for a particular role
IAzManItem myParticularRole
= application.GetItem("My Particular Role Name");
IAzManItem[] operations =
(from m
in myParticularRole.GetMembers()
where m.ItemType ==
ItemType.Operation
select m).ToArray();
//2. to get a list of roles with a certain word in the description
IAzManItem[] rolesWithDescription
= (from t
in application.GetItems(ItemType.Role)
where t.Description.Contains("foo")
select t).ToArray();
}
}
}
}
■ Andrea Ferendeles / NetSqlAzMan Project Coordinator
|