ASP.NET Core Web API .NET 8 2024 - 14. 1-To-Many CREATE (Post)
HTML-код
- Опубликовано: 8 сен 2024
- ASP.NET Core Web API .NET 8 2024 - 14. 1-To-Many CREATE (Post)
Github for this repo: github.com/ted...
Twitter: / teddysmithdev
Github: github.com/ted...
Linkedin: / teddy-smith-015ba61a3
One of the best Tutorials I've ever watched
Keep it up 🔥
Another great video, thanks for the tutorial
thanks bro
Guys just for information maybe it will help someone. Don't name your controller methods with word "Async" or you will get error 500 no route matches when you will try to use CreatedAtAction on this method.
Thanks! I wondered why this error keeps showing
I just got that error but I'm not sure I understood your solution. You mean that this Create method shouldn't be made async?
@@AlexRonai The name of function should not end with Async I think
@@MM-nj4im Weird then because I renamed CreateAsync to Create and still got the error
@@AlexRonai Sometimes cleaning the existing build and rebuilding helps. "dotnet clean" and the "dotnet watch run" or "dotnet build" "dotnet run"
Why you didn`t add [FromBody] before CreateCommentDto commentDto? From where then comes the data to create a new comment?
Or maybe i don`t understand how it works
its not mandatory to use them, because .net core automatically know it, but it can simplify the process of transferring data between client-side requests and server-side code, it reduces complexity and can help other developers read your code, so better documentation.
why do we pass the “stockId” separately from the “createCommentDto” object, why can't we just pass everything with one object?
Did you mean combining those to only one object then parsing to the Method? I think it will make us more confused when handling with a combination object.
why addasync instead of add?