Services (w/ Entity Framework) - GRAPHQL API IN .NET w/ HOT CHOCOLATE #5.2

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 13

  • @JoonhwanLee
    @JoonhwanLee 2 роки тому +5

    I thought DTO is for graphql not the db model which is also called Entity (not the one in DDD)

  • @vladmartian
    @vladmartian 2 роки тому +2

    I shure would appreciate a domain driven design video series.

    • @SingletonSean
      @SingletonSean  2 роки тому +2

      Hey Vlad, I could totally see that being useful! I also feel like there's not many robust example of DDD around, so I'd be excited to share knowledge on this. I'll have to come up with a simple but interesting domain to work with 😄 Thanks for the suggestion!

  • @nalux
    @nalux 2 роки тому +1

    Visual Studio has a built-in feature for GUID generation (at least on Enterprise) Top bar - > Tools -> Create GUID

    • @SingletonSean
      @SingletonSean  2 роки тому +1

      I never noticed that, I used to always have to install an extension for that. Thanks for pointing that out!

    • @DeanWilliams2012
      @DeanWilliams2012 Рік тому

      You can also use Powershell to generate a guid which you could then pipe to your clipboard ready to paste immediately:
      New-Guid | Set-Clipboard
      I have an alias for this in my Powershell profile so I can quickly have a new guid in my clipboard with a command like 'cng'

  • @fernandopereirafezinho3535
    @fernandopereirafezinho3535 2 роки тому

    Nice.. but how about partial updates?

  • @foxred2380
    @foxred2380 2 роки тому +1

    Seems you are not very tend to use "var"

    • @SingletonSean
      @SingletonSean  2 роки тому

      Yep! Probably just from habit because I write a lot of ES6 JavaScript and "var" is considered poor practice compared to "let" and "const". I also just like explicitly stating types in C# haha

    • @foxred2380
      @foxred2380 2 роки тому

      ​@@SingletonSean It has no decrease of perfomance. It's actually more readable, mostly if you initialize object. And you follow a Microsoft code guideline.
      Anywise, good video, keep it up.

  • @BogdanBujdea
    @BogdanBujdea Рік тому +4

    I really like this series Sean, great work! What happens when you call _coursesRepository.GetAll()? Doesn't this go to the database and fetch the entire course objects before making the Select? In this case, don't we lose performance because we're bringing the entire objects?
    I'm asking because I want to send another model than the one I have in the database, maybe with other names for the fields or I'll hide some of them, so I would use a repository but I'm concerned that I lose performance if I don't use DbContext directly like this:
    public IQueryable GetUsers([Service] ApplicationDbContext dDbContext) => dbContext.User;

    • @yunhuoni4613
      @yunhuoni4613 Рік тому

      Yeah, I think you are correct, that's why I'm doing something like public IQueryable GetUsers([Service] ApplicationDbContext dDbContext) => dbContext.User; too