Building Web APIs Part 3

preview_player
Показать описание
This is the last of a three part series where Robert is joined by Chris Woodruff who shows how to build ASP.NET Core Web APIs. In this episode, Chris goes deep into what developers should know when building real-world APIs. This episode expands on the first episode to discuss what best practices developers should think about before, during and after their API project. We look at how and why you should decouple your API from the domain and data logic in your solutions and why we should not use our Entity Framework Core entity models at the API endpoints.

Resources

Episodes:
Part 3: Testing ASP.NET Core 2.1 Web API Solutions (this episode)
Рекомендации по теме
Комментарии
Автор

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.

TPersistent
Автор

The ViewModel sounds like a web application. I would use DTO instead.

SoyUnEmilio
Автор

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".

BenHayat
Автор

19:08 Double call of does not look right. 21:10 async/await usage overhead

RedScare.
Автор

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?

truman
Автор

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).

heiko
Автор

Supervisor and repositories... I don't think that is necessary. Repos were 'fun' when we had to use the SqlDataReader....

nico-toscani
Автор

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...

gligom
Автор

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.

EricJavierHernandezSaura
Автор

Please Make the Part 1, 2 and 3 Links available

alfredcsdinc