Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
73 views

I have a basic ASP.NET Web API project. When I send a request, the serialization is done using System.Text.Json. However, when I send a non-valid json, for example text instead of number, it returns a ...
0 votes
0 answers
77 views

I have two ASP.NET Core 6.0 Web API methods with the same parameter type: [HttpPost] public IActionResult methodOne([FromForm] DtoWithDateTime dtoWithDateTime ) [HttpPost] public IActionResult ...
0 votes
2 answers
3k views

I'm trying to implement a single ModelBinder for all my DTOs: public class MyModelBinder : IModelBinder { public Task BindModelAsync(ModelBindingContext bindingContext) { var queryDto = ...
0 votes
2 answers
92 views

When receiving an object from a client on a Http API endpoint - and that object comes in as a C# object (FromBody) - is there any way to detect if the client has added a property that is not part of ...
0 votes
2 answers
810 views

I have a WarehouseDTO class with a Name field of a custom type called CustomString. I'm trying to create a custom ModelBinder to bind the type when it is passed from the front end via the controller. ...
0 votes
1 answer
1k views

I got below model and i would like to create List when its instantiated. My question is is there a way i pass only Col1 and Col2 and rowID gets generated automatically, like autoincrement. Please note,...
Ramu's user avatar
  • 363
1 vote
0 answers
169 views

I have a DtoClass which has properties of a specific class, I don't want to have a CustomModelBinder for the DtoClass but for the class of its properties; I am using asp.net core 3.1. My ModelBinder ...
1 vote
0 answers
123 views

I use ASP.NET Core 5, I want to create a custom model binder for every property that ends with ParenteseIcon and when I got the data in the server property will be like this (Client user => Value ...
0 votes
1 answer
660 views

I'm trying to pass an array of objects ( models ) to http post request but my API controller throws an error: Could not find a value in the request with name '' for binding parameter 'list' of ...
0 votes
2 answers
747 views

I have an ASP.Net Core 2.1 application. Below is my DTO public class Movie { public int Id { get; set;} public bool IsSpecial {get; set;} public IEnumerable<Ticket> Tickets { get; set; ...
0 votes
0 answers
489 views

I am new into asp.net core webAPI. I have created a Controller method that taken a request object. [HttpPost] [Route("/api/DoWork")] [ValidateModelState] public virtual IActionResult ...
2 votes
1 answer
3k views

Having a simple .NET Core API with your models posted as JSON in request body, how to have [FromBody] attribute applied to all controller methods? [Route("api/simple")] public class SimpleController :...
2 votes
1 answer
179 views

I have the following Custom Model Binder: public class AllowAndSanitizeHtmlBinder : IModelBinder { // initialize HtmlSanitizer (I want this to be injected) private HtmlSanitizer ...
0 votes
1 answer
4k views

I have a 3rd party app making POST submissions to my site with application/json in the body. I can capture a strongly typed object as: public string Postback([FromBody]MyResponse myResponse) My ...
0 votes
1 answer
526 views

We are using custom model binders, how to disable model binding for one action method, so that i can directly post data from angular http post request, I have taken different/new class as parameter ...

15 30 50 per page
1
2 3 4 5
...
23

AltStyle によって変換されたページ (->オリジナル) /