Building Web APIs Part 3

Sign in to queue

Description

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:

Embed

Download

The Discussion

  • User profile image
    AjmalY

    @Chris Woodruff, Thank You for the wonderful show. Integration testing is just awesome. Just 1 question, Is integration testing in your sample hits the actual database or mock?

    Thanks again.

  • User profile image
    Chris​Woodruff

    @AjmalY:  Thanks for the feedback. The demo I have is performing integration testing on the APIs that are hitting the database (simulating a production scenario).

  • User profile image
    Mike

    Hi,
    Really interesting video. Thanks.
    At the 20 minute mark, you checking if a specific record exists.
    If it does, it seems like you're making another call to the database to get it again.
    Is your framework smart enough to know it already has the record?
    Or am I not understanding that properly?
    Thanks,
    Mike

  • User profile image
    Deivydas

    Hi,
    Thanks for simple explanations. When you are showing integrations tests you are creating some mock data inside repository.
    What would be your thoughts about using in memory db context inside repository? Then you would first run some Post unit tests and later run GET methods. This way it could test the full path of data income/outcome and it could cover some business requirements too.

  • User profile image
    PaulTerry

    Hi @Chris Woodruff,

    Great video and series.

    When you are talking about the ViewModels for the API, I have heard the term data transfer objects (DTO) before, are these the same thing in this instance?

    Thanks,

    Paul.

  • User profile image
    Hannes

    Hi,

    Nice videos! As for controllers, wouldn't be cleaner to have a global error handler instead of doing try-catch in every action method?

  • User profile image
    Liero

    @Chris Woodruff, thanks for the series. I have a question regarding EF Core and Domain Layer:
    You have mentioned at 4:17, that "Don't couple EF Core to your project Domain".

    I had the feeling that one of the primary uses cases of the new EF Core is that we write our "Domain Entities" including behavior (DDD style) and let EF Core to serve as a repository (code first).
    I mean why else they'd add new features like mapping to private members, support for readonly navigation collections, etc.

  • User profile image
    jacopo

    Hi,

    is the sample solution available to download?

    Kr

  • User profile image
    Mounesh​Hallare
    Hi @Chris Woodruff,
    Thanks for the easily understandable video series and you really have built robust architecture for the Web API, i really adore the way you have partitioned the architecture.

    Could you please suggest me , if i wanted to build an UI along with the API , how can i start with if you have any already built UI website , please do provide and help us.

    Any resources on building the UI component is helpful

    Regards,
    Mounesh

Add Your 2 Cents