public void Register_ShouldReadAggregateAttributesOnSingleModel()
        {
            var entityGraph = _register.GetEntityGraph <AttributeTest>();

            Assert.IsTrue(entityGraph.Members.Count == 2);
            Assert.IsTrue(entityGraph.Members.Pop().Members.Count == 0);
            Assert.IsTrue(entityGraph.Members.Pop().Members.Count == 2);
        }
Exemple #2
0
        private static GraphNode GetRootNode <T>(Expression <Func <IUpdateConfiguration <T>, object> > mapping, string mappingScheme, AggregateRegister register) where T : class
        {
            GraphNode root;

            if (mapping != null)
            {
                // mapping configuration
                root = register.GetEntityGraph(mapping);
            }
            else if (mappingScheme != null)
            {
                // names scheme
                root = register.GetEntityGraph <T>(mappingScheme);
            }
            else
            {
                // attributes or null
                root = register.GetEntityGraph <T>();
            }
            return(root);
        }