RuntimeTypeBase.AddProperty Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Bu varlık türüne bir özellik ekler.
public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty AddProperty (string name, Type clrType, System.Reflection.PropertyInfo? propertyInfo = default, System.Reflection.FieldInfo? fieldInfo = default, Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, bool nullable = false, bool concurrencyToken = false, Microsoft.EntityFrameworkCore.Metadata.ValueGenerated valueGenerated = Microsoft.EntityFrameworkCore.Metadata.ValueGenerated.Never, Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior beforeSaveBehavior = Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior.Save, Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior afterSaveBehavior = Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior.Save, int? maxLength = default, bool? unicode = default, int? precision = default, int? scale = default, Type? providerPropertyType = default, Func<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.ITypeBase,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>? valueGeneratorFactory = default, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? valueConverter = default, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer = default, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? keyValueComparer = default, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerValueComparer = default, Microsoft.EntityFrameworkCore.Storage.Json.JsonValueReaderWriter? jsonValueReaderWriter = default, Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping? typeMapping = default, object? sentinel = default);
abstract member AddProperty : string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.Metadata.ValueGenerated * Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior * Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior * Nullable<int> * Nullable<bool> * Nullable<int> * Nullable<int> * Type * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.ITypeBase, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.Storage.Json.JsonValueReaderWriter * Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping * obj -> Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty
override this.AddProperty : string * Type * System.Reflection.PropertyInfo * System.Reflection.FieldInfo * Microsoft.EntityFrameworkCore.PropertyAccessMode * bool * bool * Microsoft.EntityFrameworkCore.Metadata.ValueGenerated * Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior * Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior * Nullable<int> * Nullable<bool> * Nullable<int> * Nullable<int> * Type * Func<Microsoft.EntityFrameworkCore.Metadata.IProperty, Microsoft.EntityFrameworkCore.Metadata.ITypeBase, Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator> * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.Storage.Json.JsonValueReaderWriter * Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping * obj -> Microsoft.EntityFrameworkCore.Metadata.RuntimeProperty
Public Overridable Function AddProperty (name As String, clrType As Type, Optional propertyInfo As PropertyInfo = Nothing, Optional fieldInfo As FieldInfo = Nothing, Optional propertyAccessMode As PropertyAccessMode = Microsoft.EntityFrameworkCore.PropertyAccessMode.PreferField, Optional nullable As Boolean = false, Optional concurrencyToken As Boolean = false, Optional valueGenerated As ValueGenerated = Microsoft.EntityFrameworkCore.Metadata.ValueGenerated.Never, Optional beforeSaveBehavior As PropertySaveBehavior = Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior.Save, Optional afterSaveBehavior As PropertySaveBehavior = Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior.Save, Optional maxLength As Nullable(Of Integer) = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional precision As Nullable(Of Integer) = Nothing, Optional scale As Nullable(Of Integer) = Nothing, Optional providerPropertyType As Type = Nothing, Optional valueGeneratorFactory As Func(Of IProperty, ITypeBase, ValueGenerator) = Nothing, Optional valueConverter As ValueConverter = Nothing, Optional valueComparer As ValueComparer = Nothing, Optional keyValueComparer As ValueComparer = Nothing, Optional providerValueComparer As ValueComparer = Nothing, Optional jsonValueReaderWriter As JsonValueReaderWriter = Nothing, Optional typeMapping As CoreTypeMapping = Nothing, Optional sentinel As Object = Nothing) As RuntimeProperty
Parametreler
- name
- String
Eklenecek özelliğin adı.
- clrType
- Type
Özelliğin tutacağı değerin türü.
- propertyInfo
- PropertyInfo
Karşılık gelen CLR özelliği veya null
bir gölge özellik için.
- fieldInfo
- FieldInfo
Karşılık gelen CLR alanı veya null
bir gölge özelliği için.
- propertyAccessMode
- PropertyAccessMode
PropertyAccessMode Bu özellik için kullanılan.
- nullable
- Boolean
Bu özelliğin öğesini içerip içeremeyeceğini null
belirten bir değer.
- concurrencyToken
- Boolean
Bu özelliğin eşzamanlılık belirteci olarak kullanılıp kullanılmadığını gösteren değer.
- valueGenerated
- ValueGenerated
Bu özellik için bir değerin veritabanı tarafından ne zaman oluşturulacağını belirten bir değer.
- beforeSaveBehavior
- PropertySaveBehavior
Varlık veritabanına kaydedilmeden önce bu özelliğin değiştirilip değiştirilemeyeceğini belirten bir değer.
- afterSaveBehavior
- PropertySaveBehavior
Varlık veritabanına kaydedildikten sonra bu özelliğin değiştirilip değiştirilemeyeceğini belirten bir değer.
Özelliğin Unicode karakterlerinin kalıcı olup olmayacağını belirten bir değer.
- providerPropertyType
- Type
Veritabanı sağlayıcısına gönderilmeden önce özellik değerinin dönüştürüleceği tür.
- valueGeneratorFactory
- Func<IProperty,ITypeBase,ValueGenerator>
Varsa, bu özellik için değerler oluşturmak üzere ayarlanmış fabrika.
- valueConverter
- ValueConverter
Bu özellik için özel ValueConverter küme.
- valueComparer
- ValueComparer
ValueComparer Bu özellik için.
- keyValueComparer
- ValueComparer
ValueComparer bu özelliğin anahtarlarıyla kullanılacak.
- providerValueComparer
- ValueComparer
ValueComparer Bu özelliğin sağlayıcı değerleri için kullanılacak.
- jsonValueReaderWriter
- JsonValueReaderWriter
JsonValueReaderWriter Bu özellik için.
- typeMapping
- CoreTypeMapping
CoreTypeMapping Bu özellik için.
- sentinel
- Object
Özelliğinin ayarlanmadığını dikkate almak için kullanılacak özellik değeri.
Döndürülenler
Yeni oluşturulan özellik.
Şunlara uygulanır
Entity Framework
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin