19:08 Double call of _chinookSupervisor.GetAlbumByIdAsync() does not look right. 21:10 async/await usage overhead
@TPersistent5 жыл бұрын
So much boilerplate for such a simple application. I see where it all comes from, but the feeling is that the tooling is all wrong; pounding a square peg into the round hole type of thing. The system should have some reasonable defaults, instead of having to mindlessly redefine every single thing again and again every step of the way.
@SoyUnEmilio5 жыл бұрын
The ViewModel sounds like a web application. I would use DTO instead.
@6freeborn5 жыл бұрын
DTO = ?
@SoyUnEmilio5 жыл бұрын
@@6freebornit stands for data transfer object.
@reneschindhelm44825 жыл бұрын
+1 for the KISS example
@truman56525 жыл бұрын
Superviser it's actually UnitOfWork. I don't see any reason to test CRUD operations in this application. And what about validation and audit of data?
@BenHayat5 жыл бұрын
VM or API Model doesn't really apply for Web API. It's standard name is DTO. Why not use DTO. And for the supervisor, it is called "UnitOfWork".
@heiko31695 жыл бұрын
A good guide for starters ..probably.., BUT I strongly criticise the supervisor class! Actually I would call it a bad habbit, because it violates the SOLID principles. You could have gone with provider classes for each of the models. IAlbumProvider that has the methods to retrieve albums, either all or by id or by whatever search parameter.... and so on for all the other viewmodels you have. ..even more advanced you would go for CQRS and you would have QueryHandlers and CommandHandlers (but thats probably out of the scope of this guide which should be a help for starters).
@nico-toscani5 жыл бұрын
Supervisor and repositories... I don't think that is necessary. Repos were 'fun' when we had to use the SqlDataReader....
@heiko31695 жыл бұрын
I agree that the supervisor class is in question (actually I would call it a bad habbit, because it violates the SOLID principle). Repositories on the other hand is absolutely fine and recommended to use, even with EF ! Why? Because first of all it provides those data functions you WANT to provide to the domain, and nothing more. The Domain model should NEVER contain query syntax against data entities. That's what repositories provide as function! Second, repositories are better for unit testing: they are mockable, and testable itself.
@JJZune5 жыл бұрын
Am I missing something here? This all kind of seems a bit ... clunky. Plus from my understanding the EFCore documentation seems to discourage implementations of the repository pattern (see: docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/advanced?view=aspnetcore-2.0#repository-and-unit-of-work-patterns)
@gligom5 жыл бұрын
I think that for this simple project they just write to much code. All over the Internet in all teaching stuf, they say about DRY, KISS amd here i just see alot of same code...
@alfredcsdinc5 жыл бұрын
Please Make the Part 1, 2 and 3 Links available
@ChrisWoodruff5 жыл бұрын
Part 1 channel9.msdn.com/Shows/Visual-Studio-Toolbox/Building-Web-APIs-Part-1 Part 2 channel9.msdn.com/Shows/Visual-Studio-Toolbox/Building-Web-APIs-Part-2
It is amazing how a project so simple, can be done so wrong !! I had to stop counting how many principles and best practices get violated in this video.
@ryanconnollyatwork13565 жыл бұрын
What are some of the ones that stood out for you?
@EricJavierHernandezSaura5 жыл бұрын
@@ryanconnollyatwork1356 That supervisor class is a mess, for example, it breaks the open close principle, the single responsibility principle and make almost impossible to scale that project in the future. Please don't take the criticism the bad way it is what it is
@ryanconnollyatwork13565 жыл бұрын
@@EricJavierHernandezSaura Yeah, I agree with that one for sure. It was a god class that needed to be refactored. He said he didn't like it either, maybe that was a sign.
@Xenas21275 жыл бұрын
@Eric Javier Hernandez Saura I'm quite new to the whole api thing. What would be a better implementation?
@ryanconnollyatwork13565 жыл бұрын
@@Xenas2127 There are a lot of great examples of clean architecture like this one github.com/ardalis/CleanArchitecture