這是我傳遞資料的視圖模型:
public class DriverRegisterViewModel
{
[Required]
public string Name { get; set; }
[Required]
[EmailAddress]
public string Email { get; set; }
[Required]
public string Password { get; set; }
public string MechanicTypesNames { get; set; }
public string Location { get; set; }
public string Latitude { get; set; }
public string Longitude { get; set; }
}
并面臨以下錯誤回應:
errors: {Latitude: ["The Latitude field is required."], Location: ["The Location field is required."],…}
status: 400
title: "One or more validation errors occurred."
traceId: "00-8c51a8400365bcce1564833f6a2659bd-492eeda6ab8c61f1-00"
type: "https://tools.ietf.org/html/rfc7231#section-6.5.1"
uj5u.com熱心網友回復:
在不是的欄位上使用[ValidateNever]屬性Required。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/435128.html
標籤:网
