Пример #1
0
 internal void AddEntityPropertyMappingAttributeInternal(EntityPropertyMappingAttribute attribute, bool isEFProvider)
 {
     WebUtil.CheckArgumentNull <EntityPropertyMappingAttribute>(attribute, "attribute");
     this.ThrowIfSealed();
     if (this.ResourceTypeKind != System.Data.Services.Providers.ResourceTypeKind.EntityType)
     {
         throw new InvalidOperationException(System.Data.Services.Strings.EpmOnlyAllowedOnEntityTypes(this.Name));
     }
     if (this.epmInfo == null)
     {
         this.epmInfo = new EpmInfoPerResourceType(isEFProvider);
     }
     this.OwnEpmInfo.Add(attribute);
 }
Пример #2
0
        /// <summary>
        /// Adds an <see cref="EntityPropertyMappingAttribute"/> for the resource type.
        /// </summary>
        /// <param name="attribute">Given <see cref="EntityPropertyMappingAttribute"/></param>
        public void AddEntityPropertyMappingAttribute(EntityPropertyMappingAttribute attribute)
        {
            WebUtil.CheckArgumentNull(attribute, "attribute");

            // EntityPropertyMapping attribute can not be added to readonly resource types.
            this.ThrowIfSealed();

            if (this.ResourceTypeKind != ResourceTypeKind.EntityType)
            {
                throw new InvalidOperationException(Strings.EpmOnlyAllowedOnEntityTypes(this.Name));
            }

            if (this.epmInfo == null)
            {
                this.epmInfo = new EpmInfoPerResourceType();
            }

            this.OwnEpmInfo.Add(attribute);
        }
Пример #3
0
		/// <summary> 
		/// Adds an <see cref="EntityPropertyMappingAttribute"/> for the resource type.
		/// </summary> 
		/// <param name="attribute">Given <see cref="EntityPropertyMappingAttribute"/></param> 
		public void AddEntityPropertyMappingAttribute(EntityPropertyMappingAttribute attribute)
		{

			// EntityPropertyMapping attribute can not be added to readonly resource types.
			this.ThrowIfSealed();

			if (this.ResourceTypeKind != ResourceTypeKind.EntityType)
			{
				throw new InvalidOperationException("Not an entity type");
			}

			if (this.epmInfo == null)
			{
				this.epmInfo = new EpmInfoPerResourceType();
			}

			this.OwnEpmInfo.Add(attribute);
		}
Пример #4
0
 internal void AddEntityPropertyMappingAttributeInternal(EntityPropertyMappingAttribute attribute, bool isEFProvider)
 {
     WebUtil.CheckArgumentNull<EntityPropertyMappingAttribute>(attribute, "attribute");
     this.ThrowIfSealed();
     if (this.ResourceTypeKind != System.Data.Services.Providers.ResourceTypeKind.EntityType)
     {
         throw new InvalidOperationException(System.Data.Services.Strings.EpmOnlyAllowedOnEntityTypes(this.Name));
     }
     if (this.epmInfo == null)
     {
         this.epmInfo = new EpmInfoPerResourceType(isEFProvider);
     }
     this.OwnEpmInfo.Add(attribute);
 }