You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SRModelStateDictionaryExtensions contains methods that convert an instance of ModelStateDictionary into an instance of type Result.
The SR "prefix" is so as not to cause name conflicts.
Usage
[Route("api/[controller]")]publicclassPersonController:ControllerBase{[HttpPost]publicActionResult<Result<CreatedId>>Create([FromBody]Personperson){if(ModelState.IsFailed())returnModelState.BadRequest();// Some code..}}
The text was updated successfully, but these errors were encountered:
These extension methods will be added to the ModelStateDictionary type:
SRModelStateDictionaryExtensions
contains methods that convert an instance ofModelStateDictionary
into an instance of typeResult
.The SR "prefix" is so as not to cause name conflicts.
Usage
The text was updated successfully, but these errors were encountered: