Beispiel #1
0
        public void PosTest3()
        {
            int       int1      = new Random().Next(int.MinValue, int.MaxValue);
            subclass  sub       = new subclass(int1);
            Type      type      = typeof(subclass);
            FieldInfo fieldinfo = type.GetField("v_int", BindingFlags.NonPublic | BindingFlags.Instance);
            object    obj       = fieldinfo.GetValue(sub);

            Assert.Equal(int1, (int)obj);
        }
        private void ProcessEntityTablePerClassHierarchy(Entity entity, @class classNode)
        {
            foreach (var childEntity in entity.Children)
            {
                var subclassNode = new subclass();

                subclassNode.name = childEntity.Name;
                subclassNode.discriminatorvalue = childEntity.DiscriminatorValue;

                foreach (var property in childEntity.ConcreteProperties)
                {
                    IColumn column = property.MappedColumn();
                    if (column == null)
                    {
                        continue;
                    }

                    property propNode = ProcessProperty(property, column);
                    subclassNode.AddProperty(propNode);
                }
                var referenceMapper = new ReferenceMapper();
                referenceMapper.ProcessReferences(childEntity, item => subclassNode.AddItem(item));

                classNode.AddItem1(subclassNode);
            }
            classNode.discriminator       = new discriminator();
            classNode.discriminator.force = entity.Discriminator.Force;
            //classNode.discriminator.length = entity.Discriminator.l.Force.ToString();
            //classNode.discriminator.notnull = entity.Discriminator..Force.ToString();

            if (!entity.Discriminator.Insert)
            {
                classNode.discriminator.insert = entity.Discriminator.Insert;
            }
            if (entity.Discriminator.DiscriminatorType == Providers.EntityModel.Model.Enums.DiscriminatorTypes.Column)
            {
                classNode.discriminator.column = entity.Discriminator.ColumnName;
            }
            else
            {
                classNode.discriminator.formula = entity.Discriminator.Formula;
            }
        }