Beispiel #1
0
 public SourceField(string propertyAlias, SourceFragmentDefinition sf, string column, int?sourceTypeSize,
                    bool isNullable, string sourceType, string defaultValue, string alias)
     : base(sf, column, sourceType, sourceTypeSize, isNullable, false, defaultValue)
 {
     _alias         = alias;
     _propertyAlias = propertyAlias;
 }
 public SelfRelationDefinition(EntityDefinition entity, string[] props,
                               SelfRelationTarget direct, SelfRelationTarget reverse,
                               SourceFragmentDefinition table, EntityDefinition underlyingEntity, bool disabled)
     : base(table, underlyingEntity, direct, reverse, disabled)
 {
     _entity = entity;
     _props  = props;
 }
 protected RelationDefinitionBase(SourceFragmentDefinition table, EntityDefinition underlyingEntity, SelfRelationTarget left, SelfRelationTarget right, bool disabled)
 {
     _table            = table;
     _underlyingEntity = underlyingEntity;
     _disabled         = disabled;
     _left             = left;
     _right            = right;
     _constants        = new List <RelationConstantDescriptor>();
 }
Beispiel #4
0
 public SourceFieldDefinition(SourceFragmentDefinition sf, string sourceFieldExpression, string type,
                              int?sourceTypeSize, bool isNullable, bool identity, string defaultValue)
 {
     _tbl           = sf;
     _column        = sourceFieldExpression;
     _sz            = sourceTypeSize;
     _isNotNullable = !isNullable;
     _type          = type;
     _identity      = identity;
     _defaultValue  = defaultValue;
 }
Beispiel #5
0
        public EntityPropertyDefinition(string propertyName, string propertyAlias,
                                        Field2DbRelations attributes, string description,
                                        AccessLevel fieldAccessLevel, AccessLevel propertyAccessLevel,
                                        TypeDefinition type, SourceFragmentDefinition sf, EntityDefinition entity)
            : base(propertyName, propertyAlias, type, attributes, description, fieldAccessLevel, propertyAccessLevel, entity)
        {
            if (!type.IsEntityType)
            {
                throw new ArgumentException(string.Format("EntityProperty type must be a entity type. Passed {0}", type.Identifier));
            }

            _sf = sf;
        }
Beispiel #6
0
        private void CheckSourceFragment(SourceFragmentDefinition sf)
        {
            if (Model != null && !Model.GetSourceFragments().Any(item => item.Identifier == sf.Identifier))
            {
                throw new ArgumentException(
                          string.Format("SourceFragment {0} not found in Model.SourceFragment collection", sf.Identifier));
            }

            if (GetSourceFragments().Any(item => item.Identifier == sf.Identifier))
            {
                throw new ArgumentException(
                          string.Format("SourceFragment {0} already in SourceFragments collection", sf.Identifier));
            }
        }
Beispiel #7
0
        public SourceFragmentDefinition GetOrCreateSourceFragment(string selector, string name)
        {
            SourceFragmentDefinition sf = GetSourceFragments().SingleOrDefault(item =>
                                                                               item.Selector == selector && item.Name == name);

            if (sf == null)
            {
                if (string.IsNullOrEmpty(selector))
                {
                    sf = new SourceFragmentDefinition(name, name, selector);
                }
                else
                {
                    sf = new SourceFragmentDefinition(selector + "." + name, name, selector);
                }
            }


            return(sf);
        }
Beispiel #8
0
 public IEnumerable <SourceFieldDefinition> GetSourceFields(SourceFragmentDefinition sf)
 {
     return(from c in _columns
            where c.SourceFragment == sf
            select c);
 }
Beispiel #9
0
 public SourceFieldDefinition(SourceFragmentDefinition sf, string sourceFieldExpression, string type)
     : this(sf, sourceFieldExpression, type, null, true, false, null)
 {
 }
 protected RelationDefinitionBase(SourceFragmentDefinition table, EntityDefinition underlyingEntity, SelfRelationTarget left, SelfRelationTarget right)
     : this(table, underlyingEntity, left, right, false)
 {
 }
 public SelfRelationDefinition(EntityDefinition entity, string[] props,
                               SelfRelationTarget direct, SelfRelationTarget reverse,
                               SourceFragmentDefinition table, EntityDefinition underlyingEntity)
     : this(entity, props, direct, reverse, table, underlyingEntity, false)
 {
 }
 public SourceFragmentRefDefinition(SourceFragmentDefinition sf)
     : base(sf.Identifier, sf.Name, sf.Selector)
 {
 }