Ejemplo n.º 1
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>
        protected TypeBase([NotNull] Type clrType, [NotNull] Model model, ConfigurationSource configurationSource)
            : this(model, configurationSource)
        {
            Check.NotNull(model, nameof(model));

            Name    = model.GetDisplayName(clrType);
            ClrType = clrType;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        protected TypeBase([NotNull] Type clrType, [NotNull] Model model, ConfigurationSource configurationSource)
            : this(model, configurationSource)
        {
            Check.NotNull(model, nameof(model));

            Name             = model.GetDisplayName(clrType);
            ClrType          = clrType;
            HasSharedClrType = false;
            IsPropertyBag    = clrType.IsPropertyBagType();
        }
Ejemplo n.º 3
0
        protected TypeBase([NotNull] Type type, [NotNull] Model model, ConfigurationSource configurationSource)
        {
            Check.NotNull(model, nameof(model));

            ClrType = type;
            Model   = model;
            _configurationSource = configurationSource;
            Name = model.GetDisplayName(type);
            _hasSharedClrType = false;
            IsPropertyBag     = type.IsPropertyBagType();
        }
        /// <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 UnmarkAsOwnedType([NotNull] this Model model, [NotNull] Type clrType)
        {
            if (!(model[CoreAnnotationNames.OwnedTypesAnnotation] is HashSet <string> ownedTypes))
            {
                return;
            }

            while (clrType != null)
            {
                ownedTypes.Remove(model.GetDisplayName(clrType));

                clrType = clrType.BaseType;
            }
        }
Ejemplo n.º 5
0
 public TypeIdentity([NotNull] Type type, [NotNull] Model model)
 {
     Name = model.GetDisplayName(type);
     Type = type;
 }
 /// <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 MarkAsOwnedType([NotNull] this Model model, [NotNull] Type clrType)
 => model.MarkAsOwnedType(model.GetDisplayName(clrType));
Ejemplo n.º 7
0
 public TypeIdentity(Type type, Model model)
 {
     Name    = model.GetDisplayName(type);
     Type    = type;
     IsNamed = false;
 }