Asp.Net Core tutorial for absolute beginners (10): The service layer

Поділитися
Вставка
  • Опубліковано 20 чер 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

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

    Thanks again for this great content! I truly love your teaching style. If I have a vote for your question, I would LOVE an ASP.NET Core INTERMEDIATE course. : )

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

      Thank you very much for your vote :)

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

    If you pursued these courses in a way that correlates to teaching someone a full stack of some kind, I think that would be best. :] Maybe not for the algorithm, but probably for the people watching! xD
    Refactoring is always nice too though. :]

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

    Thank you very much for this video as well, when we have a problem in EF like in here and if we have to delete tables. we have to delete those same tables in UAT/PROD when we deploy the code, that means we are going to lose all the data in those environments, what is your advise for that? Also should we move the AutoMapper profiles into the service layer as well and keep the controller clean and lean ?

    • @Codewrinkles
      @Codewrinkles  Рік тому +1

      So, regarding tables. Somethings like this SHOULD NEVER BE DONE in production or other environments. Usually in prod we have CI/CD pipelines that do the deployments, including database updates. To update a database via script, there is tooling that generates update scripts that are then used to update the database. More recently, EF Core has some support for this using migration bundles.
      Regarding AutoMapper, I don't think it should be moved into the service layer. The service layer should in my opinion only be responsible to handle business and application logic. Preparing the data to be returned from a controller action should be done in the API layer. Simple mapping doesn't really make your controller that ugly.

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

      @@Codewrinkles Thank you for the response, appreciate it

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

      @@krishanthadharmasiri5266 You're welcome!

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

    I think Reservation system needs elaboration in case of multiple reservations