Asp.Net Core tutorial for absolute beginners (11): Extending the reservation controller

Поділитися
Вставка
  • Опубліковано 26 чер 2024
  • In this lesson we'll talk about what is and how to work with a service layer in Asp.Net Core application.
    #AspNetCore #DotNetCore #CSharp
    GitHub branch containing this lesson's code: github.com/danpdc/aspNetCoreB...
  • Наука та технологія

КОМЕНТАРІ • 8

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

    Hi Dan, thank you so much for your effort. You are a great teacher! I was wondering if you will talk a little bit about unit testing next week.

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

      Great suggestion! However, I am not sure. The way I see it, unit testing API is something for a potential Asp.Net Core Intermediate course since it actually requires running an Asp.Net Core app programatically by wiring into the Startup pipeline and using a test server. It's not really too complicated but it is outside the fundamentals.

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

      @@Codewrinkles are you planning doing an intermediate course? It would be awesome.

    • @Codewrinkles
      @Codewrinkles  2 роки тому +4

      @@pinarburuncuk6948 Yes, that totally is the plan. But for that course I'd have to first create a structure, plan and so on. So, probably I'll start it in March.

  • @lowzyyy
    @lowzyyy 3 місяці тому

    i am finding it hard to differentiate between repository and service. In this lesson we are doing crud opeartions from the service, exactly the same functionality as the hotel repository.
    Also what is the purpose of modelState.isValid if controller throw instantly when model is not valid?

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

    Hey bud, could you give a note on the github readme on how to setup one of the previous lessons? I got to this lesson, had a bug I couldn't solve, deleted my project, tried to load lesson 10 material and can't get it working. xD. but also :C
    It's giving me this booger:
    "CONSTRAINT [FK_Reservations_Hotels_HotelId] FOREIGN KEY ([HotelId]) REFERENCES [Hotels] ([HotelId]) ON DELETE CASCADE,
    CONSTRAINT [FK_Reservations_Rooms_RoomId] FOREIGN KEY ([RoomId]) REFERENCES [Rooms] ([RoomId]) ON DELETE CASCADE
    );"
    and this:
    "Introducing FOREIGN KEY constraint 'FK_Reservations_Rooms_RoomId' on table 'Reservations' may cause cycles or multiple cascade paths."
    Sorry if this is a me problem, and not a problem with the github upload.

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

      I guess I remember we had a similar problem at a certain point too. Can you maybe just checkout the next lesson and test it there? Also, before you run the app, don't forget to run update-database in the package manager console with the DAL project set as default.

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

      ​@@Codewrinkles I do recall something similar before, yes. The update-database command is what causes the error, sorry I forgot to mention. Yes, I can download the files for 11 and test that too. I feel like I'm always asking questions and grasping around. Sorry for that. I hope someday to be in your position helping others.