protected override List<IReference> GetImplementingReferences(IClass scope, ITransformationContext context) { var generatedType = context.Trace.ResolveIn(Rule<Class2Type>(), scope); var r2p = Rule<Reference2Property>(); return (from c in scope.Closure(c => c.BaseTypes) from r in c.References where generatedType.Members.Contains(context.Trace.ResolveIn(r2p, r)) select r).ToList(); }
protected override List <IReference> GetImplementingReferences(IClass scope, ITransformationContext context) { var generatedType = context.Trace.ResolveIn(Rule <Class2Type>(), scope); var r2p = Rule <Reference2Property>(); return((from c in scope.Closure(c => c.BaseTypes) from r in c.References where generatedType.Members.Contains(context.Trace.ResolveIn(r2p, r)) select r).ToList()); }
public ModelTestBase() { Class = MetaRepository.Instance.ResolveClass(typeof(T)) as IClass; AllAncestors = Class.Closure(c => c.BaseTypes).ToList(); foreach (var r in AllAncestors.SelectMany(c => c.References)) { if (r.Refines != null && !refinesLookup.ContainsKey(r.Refines)) { refinesLookup.Add(r.Refines, r); } } foreach (var attC in AllAncestors.SelectMany(c => c.AttributeConstraints)) { fixedAttributes.Add(attC.Constrains); } foreach (var refC in AllAncestors.SelectMany(c => c.ReferenceConstraints)) { if (!refinesLookup.ContainsKey(refC.Constrains)) { refinesLookup.Add(refC.Constrains, null); } } }