IConventionEntityType.AddServiceProperty Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddServiceProperty(MemberInfo, Type, Boolean) |
Adds a service property to this entity type. |
AddServiceProperty(MemberInfo, Boolean) |
Adds a service property to this entity type. |
AddServiceProperty(MemberInfo, Type, Boolean)
Adds a service property to this entity type.
public Microsoft.EntityFrameworkCore.Metadata.IConventionServiceProperty AddServiceProperty (System.Reflection.MemberInfo memberInfo, Type? serviceType = default, bool fromDataAnnotation = false);
abstract member AddServiceProperty : System.Reflection.MemberInfo * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionServiceProperty
Public Function AddServiceProperty (memberInfo As MemberInfo, Optional serviceType As Type = Nothing, Optional fromDataAnnotation As Boolean = false) As IConventionServiceProperty
Parameters
- memberInfo
- MemberInfo
The PropertyInfo or FieldInfo of the property to add.
- serviceType
- Type
The type of the service, or null
to use the type of the member.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The newly created service property.
Applies to
AddServiceProperty(MemberInfo, Boolean)
Adds a service property to this entity type.
public Microsoft.EntityFrameworkCore.Metadata.IConventionServiceProperty AddServiceProperty (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
abstract member AddServiceProperty : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionServiceProperty
Public Function AddServiceProperty (memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionServiceProperty
Parameters
- memberInfo
- MemberInfo
The PropertyInfo or FieldInfo of the property to add.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The newly created service property.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for