Exemplo n.º 1
0
        /// <summary>
        ///     Adds a property to this entity.
        /// </summary>
        /// <param name="entityType"> The entity type to add the property to. </param>
        /// <param name="propertyInfo"> The corresponding property in the entity class. </param>
        /// <returns> The newly created property. </returns>
        public static IMutableProperty AddProperty(
            [NotNull] this IMutableEntityType entityType, [NotNull] PropertyInfo propertyInfo)
        {
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(propertyInfo, nameof(propertyInfo));

            return(entityType.AsEntityType().AddProperty(propertyInfo));
        }
Exemplo n.º 2
0
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public static void AddData([NotNull] this IMutableEntityType entityType, [NotNull] IEnumerable <object> data)
 => entityType.AsEntityType().AddData(data);
        /// <summary>
        ///     Sets the discriminator value for this entity type.
        /// </summary>
        /// <param name="entityType"> The entity type to set the discriminator value for. </param>
        /// <param name="value"> The value to set. </param>
        public static void SetDiscriminatorValue([NotNull] this IMutableEntityType entityType, [CanBeNull] object value)
        {
            entityType.AsEntityType().CheckDiscriminatorValue(entityType, value);

            entityType.SetAnnotation(CoreAnnotationNames.DiscriminatorValue, value);
        }
Exemplo n.º 4
0
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public static void AddData([NotNull] this IMutableEntityType entityType, [NotNull] params object[] data)
 => entityType.AsEntityType().AddData(data);