public RepositorySecObjectProvider(SecurityObjectKind kind)
 //: this( kind, ( r, id ) => r.All.FirstOrDefault( e => e.SID == id ) )
 {
 }
Exemplo n.º 2
0
 public static ISecurityObject MockObject(Guid sid, SecurityObjectKind kind = null)
 {
     return(new ObjectImpl {
         ID = sid, Kind = kind
     });
 }
 public ExplicitSecObjectProvider(IEnumerable <ISecurityObject> objs)
 {
     //Contract.Requires<InvalidOperationException>( objs.GroupBy( o => o.Kind ).Count() <= 1, "The initialization list contains objects of more than one kind" );
     _objects = new SortedList <Guid, ISecurityObject>(objs.ToDictionary(o => o.ID));
     Kind     = objs.MaybeFirst().Select(o => o.Kind).ValueOrNull();
 }