Class SystemDataSqlServerAttributeReader
Adds support for types and functions, defined in Microsoft.SqlServer.Types spatial types (or any other types and methods, that use SqlMethodAttribute or SqlUserDefinedTypeAttribute mapping attributes). Check https://linq2db.github.io/articles/FAQ.html#how-can-i-use-sql-server-spatial-types for additional required configuration steps to support SQL Server spatial types.
public class SystemDataSqlServerAttributeReader : IMetadataReader
- Inheritance
-
SystemDataSqlServerAttributeReader
- Implements
- Extension Methods
Constructors
SystemDataSqlServerAttributeReader(Type, Type)
Creates new instance of SystemDataSqlServerAttributeReader.
public SystemDataSqlServerAttributeReader(Type sqlMethodAttribute, Type sqlUserDefinedTypeAttribute)
Parameters
sqlMethodAttribute
TypeSqlMethodAttribute type.
sqlUserDefinedTypeAttribute
TypeSqlUserDefinedTypeAttribute type.
Fields
MicrosoftDataSqlClientProvider
Provider instance, which use mapping attributes from Microsoft.Data.SqlClient assembly (v1-4). Could be null of assembly not found.
public static IMetadataReader? MicrosoftDataSqlClientProvider
Field Value
MicrosoftSqlServerServerProvider
Provider instance, which uses mapping attributes from Microsoft.SqlServer.Server assembly. Used with Microsoft.Data.SqlClient provider starting from v5. Could be null of assembly not found.
public static IMetadataReader? MicrosoftSqlServerServerProvider
Field Value
SystemDataSqlClientProvider
Provider instance, which use mapping attributes from System.Data.SqlClient assembly. Could be null of assembly not found.
public static IMetadataReader? SystemDataSqlClientProvider
Field Value
Methods
GetAttributes(Type)
Gets all mapping attributes on specified type.
public MappingAttribute[] GetAttributes(Type type)
Parameters
type
TypeAttributes owner type.
Returns
- MappingAttribute[]
Array of mapping attributes.
GetAttributes(Type, MemberInfo)
Gets all mapping attributes on specified type member.
public MappingAttribute[] GetAttributes(Type type, MemberInfo memberInfo)
Parameters
type
TypeMember type. Could be used by some metadata providers to identify actual member owner type.
memberInfo
MemberInfoType member for which mapping attributes should be returned.
Returns
- MappingAttribute[]
Array of attributes.
GetDynamicColumns(Type)
Gets the dynamic columns defined on given type.
public MemberInfo[] GetDynamicColumns(Type type)
Parameters
type
TypeThe type.
Returns
- MemberInfo[]
All dynamic columns defined on given type.
GetObjectID()
Should return a unique ID for cache purposes. If the implemented Metadata reader returns instance-specific data you'll need to calculate a unique value based on content. Otherwise just use a static const e.g. $".{nameof(YourMetadataReader)}."
public string GetObjectID()
Returns
- string
The object ID as string