ValidationContext Oluşturucular
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.
ValidationContext sınıfının yeni bir örneğini başlatır.
Aşırı Yüklemeler
| Name | Description |
|---|---|
| ValidationContext(Object) |
Belirtilen nesne örneğini kullanarak sınıfın ValidationContext yeni bir örneğini başlatır. |
| ValidationContext(Object, IDictionary<Object,Object>) |
Belirtilen nesneyi ve isteğe bağlı bir özellik paketini kullanarak sınıfın yeni bir örneğini ValidationContext başlatır. |
| ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>) |
Hizmet sağlayıcısını ValidationContext ve hizmet tüketicilerinin sözlüğünü kullanarak sınıfının yeni bir örneğini başlatır. |
| ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>) |
ValidationContext, isteğe bağlı ve isteğe bağlı |
ValidationContext(Object)
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
Belirtilen nesne örneğini kullanarak sınıfın ValidationContext yeni bir örneğini başlatır.
public:
ValidationContext(System::Object ^ instance);
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance);
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object)
Parametreler
- instance
- Object
Doğrulanması gereken nesne örneği.
nullolamaz.
- Öznitelikler
Özel durumlar
instance, null'e eşittir.
Şunlara uygulanır
ValidationContext(Object, IDictionary<Object,Object>)
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
Belirtilen nesneyi ve isteğe bağlı bir özellik paketini kullanarak sınıfın yeni bir örneğini ValidationContext başlatır.
public:
ValidationContext(System::Object ^ instance, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object> items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, items As IDictionary(Of Object, Object))
Parametreler
- instance
- Object
Doğrulanması gereken nesne örneği.
nullolamaz.
- items
- IDictionary<Object,Object>
Tüketicilerin kullanımına sunulması için isteğe bağlı bir anahtar/değer çifti kümesi.
- Öznitelikler
Özel durumlar
instance, null'e eşittir.
Açıklamalar
ise itemsnull, boş bir sözlük oluşturulur. Null değilse items , anahtar/değer çiftleri kümesi yeni bir sözlüğe kopyalanır ve tüketicilerin özgün sözlüğü değiştirmesini engeller.
Şunlara uygulanır
ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>)
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
Hizmet sağlayıcısını ValidationContext ve hizmet tüketicilerinin sözlüğünü kullanarak sınıfının yeni bir örneğini başlatır.
public:
ValidationContext(System::Object ^ instance, IServiceProvider ^ serviceProvider, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, IServiceProvider serviceProvider, System.Collections.Generic.IDictionary<object,object> items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")]
public ValidationContext(object instance, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Constructing a ValidationContext without a display name is not trim-safe because it uses reflection to discover the type of the instance being validated in order to resolve the DisplayNameAttribute when a display name is not provided.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of instance cannot be statically discovered and the Type's properties can be trimmed.")>]
new System.ComponentModel.DataAnnotations.ValidationContext : obj * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))
Parametreler
- instance
- Object
Doğrulanması gereken nesne. Bu parametre gereklidir.
- serviceProvider
- IServiceProvider
Arabirimini uygulayan IServiceProvider nesne. Bu parametre isteğe bağlıdır.
- items
- IDictionary<Object,Object>
Hizmet tüketicilerinin kullanımına sunulabilecek anahtar/değer çiftleri sözlüğü. Bu parametre isteğe bağlıdır.
- Öznitelikler
Özel durumlar
instance, null'e eşittir.
Açıklamalar
parametresi, serviceProvider özel doğrulama gerçekleştirmek için yöntemi tarafından GetService kullanılabilecek bir hizmeti temsil eder.
items parametresi ise nullboş bir sözlük oluşturulur. parametresi değilse null, anahtar/değer çiftleri kümesi yeni bir sözlüğe kopyalanır ve bu da hizmet tüketicilerinin özgün sözlüğü değiştirmesini engeller.
Şunlara uygulanır
ValidationContext(Object, String, IServiceProvider, IDictionary<Object,Object>)
- Kaynak:
- ValidationContext.cs
- Kaynak:
- ValidationContext.cs
ValidationContext, isteğe bağlı ve isteğe bağlı displayNameözellik paketi serviceProviderile itemsbelirli bir nesne örneği için bir oluşturur.
public:
ValidationContext(System::Object ^ instance, System::String ^ displayName, IServiceProvider ^ serviceProvider, System::Collections::Generic::IDictionary<System::Object ^, System::Object ^> ^ items);
public ValidationContext(object instance, string displayName, IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
new System.ComponentModel.DataAnnotations.ValidationContext : obj * string * IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> System.ComponentModel.DataAnnotations.ValidationContext
Public Sub New (instance As Object, displayName As String, serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))
Parametreler
- instance
- Object
Doğrulanan nesne örneği.
nullolamaz.
- displayName
- String
Nesne örneğiyle ilişkilendirilmiş görünen ad.
- serviceProvider
- IServiceProvider
Çağrıldığında GetService(Type) kullanmak için isteğe bağlıdırIServiceProvider.
isenullGetService(Type), her zaman döndürürnull.
- items
- IDictionary<Object,Object>
aracılığıyla Itemstüketicilerin kullanımına sunulması için isteğe bağlı anahtar/değer çiftleri kümesi.
ise null, boş bir sözlük oluşturulur.
nulldeğilse, anahtar/değer çiftleri kümesi yeni bir sözlüğe kopyalanır ve böylece tüketicilerin özgün sözlüğü değiştirmesi engellenir.
Özel durumlar
Ne zaman instancenull
Açıklamalar
DisplayName ayarını desteklemek için türünü instance çözümlemek için yansıma kullanmadığından bu oluşturucu kırpma açısından güvenlidir.