ProducesErrorResponseTypeAttribute Sınıf
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.
ile ApiControllerAttributeek açıklama ekli denetleyiciler tarafından varsayılan olarak döndürülen türü belirtir.
Type hiçbir değer sağlanmazsa istemci hatası (HTTP Durum Kodu 4xx) için ile ProducesResponseTypeAttribute ilişkili hata modeli türünü belirtir. Değer belirtilmediğinde, istemci hataları (ClientErrorMapping) eşleniyorsa MVC, istemci hata türünü ProblemDetailsolarak kabul eder.
Uygulamanız yanıt vermek için özel bir hata türü kullanıyorsa, varsayılan hata türünü yapılandırmak için bunu Attribute kullanın.
public ref class ProducesErrorResponseTypeAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class ProducesErrorResponseTypeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesErrorResponseTypeAttribute = class
inherit Attribute
Public NotInheritable Class ProducesErrorResponseTypeAttribute
Inherits Attribute
- Devralma
-
ProducesErrorResponseTypeAttribute
- Öznitelikler
Oluşturucular
ProducesErrorResponseTypeAttribute(Type) |
öğesinin yeni bir örneğini ProducesErrorResponseTypeAttributebaşlatır. |
Özellikler
Type |
Varsayılan hata türünü alır. |
Şunlara uygulanır
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