Bagikan melalui


FromBodyAttribute Kelas

Definisi

Menentukan bahwa parameter atau properti harus terikat menggunakan isi permintaan.

public ref class FromBodyAttribute : Attribute, Microsoft::AspNetCore::Mvc::ModelBinding::IBindingSourceMetadata
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class FromBodyAttribute : Attribute, Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class FromBodyAttribute : Attribute, Microsoft.AspNetCore.Http.Metadata.IFromBodyMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type FromBodyAttribute = class
    inherit Attribute
    interface IBindingSourceMetadata
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type FromBodyAttribute = class
    inherit Attribute
    interface IBindingSourceMetadata
    interface IFromBodyMetadata
Public Class FromBodyAttribute
Inherits Attribute
Implements IBindingSourceMetadata
Public Class FromBodyAttribute
Inherits Attribute
Implements IBindingSourceMetadata, IFromBodyMetadata
Warisan
FromBodyAttribute
Atribut
Penerapan

Keterangan

Secara default, ASP.NET Core MVC mendelegasikan tanggung jawab membaca isi ke formatter input.
Dalam kasus api ASP.NET Core Minimal, tubuh dideserialisasi oleh JsonSerializer.

Konstruktor

FromBodyAttribute()

Menentukan bahwa parameter atau properti harus terikat menggunakan isi permintaan.

Properti

BindingSource

Mendapatkan BindingSource.

EmptyBodyBehavior

Mendapatkan atau menetapkan nilai yang memutuskan apakah pengikatan model tubuh harus memperlakukan input kosong sebagai valid.

Implementasi Antarmuka Eksplisit

IFromBodyMetadata.AllowEmpty

Menentukan bahwa parameter atau properti harus terikat menggunakan isi permintaan.

Berlaku untuk