This tutorial series is now also available as an online video course. You can watch the first hour on YouTube or get the complete course on Udemy....
For further actions, you may consider blocking this person and/or reporting abuse
Hi Patrick,
Under the DTO section, you write, ...First things first, letβs create a folder called Dtos and then another folder called Character for all the data transfer objects regarding the RPG characters."
Here's where we get into trouble. You don't specify where either DTO folder or Character folder should be, or if there's a parent-child relationship to them. It's only hinted at further down when you show: using dotnet_rpg.Dtos.Character
May I suggest being a little more precise with the wording? How about:
First things first, lets create a folder under the main project called 'Dtos' and then under the new 'Dtos' folder, a child folder 'Character'.
Further down, we create the GetCharacterDto and AddCharacterDto classes, and as I've personally discovered, it's really easy to miss the little namespace detail, so those two classes should be INSIDE the Dtos.Character folder, not the Dtos folder.
I know that it's hard writing tutorials that keep it concise and clean - too many words does tend to shut some people down. Thanks for taking the time and making the effort to write what is otherwise a very clean and well crafted tutorial.
Hey Michael,
Thank you very much for your comment. I'll keep that in mind for the upcoming parts.
In general, it doesn't really matter if you follow the folder structure completely.
VS Code will use the proper namespace of your structure, anyways.
But it's a good point!
Take care,
Patrick
Thanks Patric for the great series!
In this chapter I think you're missing to add changes to CharacterController while implementing DTOs.
Parameter type change from Character to AddCharacterDto.
or am I missing something?
Hey Alessandro,
Thank you very much! You're absolutely right, I totally forgot to add this.
I fixed that now. The change of the types is done right before adding AutoMapper.
Have a great day!
Take care,
Patrick
Hi Patrick
I'm learning from your lessons. Repeating all your actions.
Not paying attention to the following warnings, such as
"This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [dotnet-rpg]"
Postman returns this error:
{
"type": "tools.ietf.org/html/rfc7231#sectio...",
"title": "Unsupported Media Type",
"status": 415,
"traceId": "|738fe68b-408ee4ce1960c8d1."
}
What am I doing wrong?
With respect.
P.S. Just in case, I put a link to the repository. [github.com/GhostBasenji/dotnet-rpg]
Hi!
Thank you!
The async warning should disappear later when you're using EF Core and "real" asynchronous methods.
The Postman warning is strange. What's the URI you are using and what method do you want to call? Maybe your body is not configured properly. Did you select text/json?
Hope this helps, and thanks for waiting!
Take care,
Patrick
Hi Patrick,
An amazing article so far.
It called my attention the section called "Proper Service Response with Generics" because it is something that I have done many times in my projects and other developers have laughed at me because they did not see it as useful.
For me, it is one of the thing most useful because there is always an answer, no matter if the app fails, the app records the fail internally and give back a proper answer for the client but never an ugly error that could be handled.
So, thank you for mention it, I see that others have been thru this situation.
Sincerely,
Juan Boada
Hi Patrick, we followed your tip to use the ServiceResponse class, but we got feedback that things as OkObjectResult, or NotFoundObjectResult were not available for the consumer of the API's. So instead of returning an ActionResult<>, we returned a ServiceResponse<>. Did we do something wrong? How do you consider this?
Thanks in advance. Regards, Henk
Do you have a github repo link for this tutorial?
Yep, GitHub repo is now available here: github.com/patrickgod/dotnet-rpg
Thank you, loved your tutorial. it got me started with Dotnet core 3 in a single day.
nice one. what about the unit of work pattern with repos
Great Article Patrick
Thank you very much!
Great series, thank you so much.
Glad you like it! Thank you very much for your feedback! :)
Great series, thank you so much, it was useful to me.
Hi Patrick,
Great tutorial !! . I have a question, why was the mapper implemented in service rather than the controller? Wouldnt it be better if we implemented the mapping in the controller?