Пример #1
0
 public bool TryGetEntitySet(string name, out CustomEntitySetType entitySet)
 {
     CustomUtils.CheckArgumentNotNull(name, "name");
     if (_entitySets.TryGetValue(name, out entitySet))
     {
         return(true);
     }
     return(false);
 }
Пример #2
0
        public void Add(CustomEntitySetType entitySet)
        {
            CustomEntitySetType otherEntitySet;

            if (_entitySets.TryGetValue(entitySet.Name, out otherEntitySet))
            {
                throw new CustomMetadataException(String.Format(
                                                      "EntitySet with the same name '{0}' has already been registred" +
                                                      " as EntitySet for '{1}'",
                                                      entitySet.Name,
                                                      entitySet.BaseElementType
                                                      ));
            }
            _entitySets[entitySet.Name] = entitySet;
        }
Пример #3
0
        public void DefferedInitialization(
            bool isPrimaryEnd,
            CustomEntitySetType entitySetType,
            CustomEntityType entityType,
            CustomNavigationPropertyType relatedProperty,
            CustomMultiplicity multiplicity
            )
        {
            Debug.Assert(!_readonly);

            _isPrimaryEnd    = isPrimaryEnd;
            _entitySetType   = entitySetType;
            _entityType      = entityType;
            _relatedProperty = relatedProperty;
            _multiplicity    = multiplicity;

            _readonly = true;
        }
Пример #4
0
        public override bool Equals(object obj)
        {
            CustomEntitySetType other = obj as CustomEntitySetType;

            return(null == other ? false : Name.Equals(other.Name) && BaseElementType.Equals(other.BaseElementType));
        }