Example #1
0
        // Methods
        protected override object CreateEntity()
        {
            // SubEntityGroupName
            string subEntityGroupName = this.SubEntityGroupName;
            if (string.IsNullOrEmpty(subEntityGroupName) == true) throw new InvalidOperationException();

            // SubEntity
            SubEntity subEntity = this.ReflectContext.CreateEntity<SubEntity>(subEntityGroupName);
            if (subEntity == null) throw new InvalidOperationException();

            // Create
            TopEntity topEntity = new TopEntity(subEntity);

            // Return
            return topEntity;
        }
Example #2
0
        static void Main(string[] args)
        {
            // Create
            ReflectContext reflectContext = Program.Create();

            // CreateEntity
            TopEntity topEntity = reflectContext.CreateEntity <TopEntity>("TopEntityGroup");

            // Print
            Console.WriteLine("\nTopEntity.SubEntity.Print()");
            topEntity.SubEntity.Print();

            // End
            Console.WriteLine("\nPress enter to end...");
            Console.ReadLine();
        }
Example #3
0
        // Methods
        protected override object CreateEntity()
        {
            // SubEntityGroupName
            string subEntityGroupName = this.SubEntityGroupName;

            if (string.IsNullOrEmpty(subEntityGroupName) == true)
            {
                throw new InvalidOperationException();
            }

            // SubEntity
            SubEntity subEntity = this.ReflectContext.CreateEntity <SubEntity>(subEntityGroupName);

            if (subEntity == null)
            {
                throw new InvalidOperationException();
            }

            // Create
            TopEntity topEntity = new TopEntity(subEntity);

            // Return
            return(topEntity);
        }