I am using Xtensive.Orm.Security extensions (4.6.4). I have added this assembly in the Domain build process.

However, I cannot query the roles : when executing Query.All<role>().ToList(), i get the exception : Type 'Role' not found in model.

I can see there is not table in the database for Xtensive.Orm.Security.Role. I guess it's because there are only abstract entities in this assembly.

Can I workaround this other than adding a layer in the role hierarchy, like adding MyRole : Role and inheriting existing roles from MyRole instead of Role and then doing Query.All<myrole>() ?

Regards, Benoit

asked Sep 09 '15 at 04:13

Benoit%20Nesme's gravatar image

Benoit Nesme

edited Sep 09 '15 at 04:14

2 Answers:

Hello Benoit Nesme

Actually, you must create some implementation of Role and mark one of descendants of Role by HierarchyRootAttribute.

Xtensive.Orm.Security.Role is abstract class which is directly interited from Xtensive.Orm.Entity. It does not belong to any hierarchy. Like Entity, Role serves as base class for user classes of model, but it defines group of classes with special purpose - roles.

answered Sep 09 '15 at 07:23

Alexey%20Kulakov's gravatar image

Alexey Kulakov

Thanks Alexey, I found another way without recreating another layer of hierarchy : querying the interface IRole, instead of Role, works. If I can run Query.All<irole>(), I get what I want.

(Sep 09 '15 at 07:26) Benoit Nesme Benoit%20Nesme's gravatar image

Querying the interface IRole instead of Role solves the issue.

answered Sep 09 '15 at 07:27

Benoit%20Nesme's gravatar image

Benoit Nesme

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA