A Beginners' Guide to Blazor WebAssembly - CRUD Operations

Поделиться
HTML-код
  • Опубликовано: 16 фев 2023
  • How to add CRUD operations to a Blazor WebAssembly project. The database is SQLite and Dapper is used.
    Useful links:
    Video script, including code: blazorcode.uk/countriesandcit...
    DB Browser for SQLite: sqlitebrowser.org
    Dapper: github.com/DapperLib/Dapper
    SQLite Tutorial: www.sqlitetutorial.net
    Learn Dapper: www.learndapper.com
    Dapper Tutorial - Dynamic Parameters: dapper-tutorial.net/parameter...
  • НаукаНаука

Комментарии • 18

  • @atirah14
    @atirah14 Год назад

    Christopher, Edit, finally works for me. Instead of manually typing the code, by watching tutorial after tutorial, i just copied the code from your website and redid the entire application until the CRUD Edit/Update to see whether the code works. It finally did. I think this was my 4th attempt. I must have made a mistake somewhere. I'll now try to see where i made a mistake. Thanks a lot for these videos. They are really good.

    • @christopherbell7186
      @christopherbell7186  Год назад

      I'm very relieved to hear it wasn't a CORS problem! Even more pleased that you were able to get it working.

  • @JohnMarsing
    @JohnMarsing Год назад

    thanks Christopher

  • @christianrazvan
    @christianrazvan Год назад

    A very clear explanation! Good job! 👍

  • @therats2270
    @therats2270 Год назад

    Thank you

  • @atirah14
    @atirah14 Год назад

    This is the second time that I did the entire tutorial, on clicking save in the countriesaddedit form, the country does not save and show up on the list. I’m getting a 404 error. I ended up deleting the entire application. I’m feeling disheartened. Maybe I’ll try for the 3rd time and see

  • @scotolivera8207
    @scotolivera8207 4 месяца назад

    Thank you for this Great Tutorial, I there a way to have the source code of this project that used with Sqlite & Dapper?

    • @christopherbell7186
      @christopherbell7186  4 месяца назад +1

      Yes. I have a website where I give details of these videos. The page you need is: blazorcode.uk/countriesandcitieswasm/crud-operations/ and at the bottom of the page you will see a link to a further page called 'Code'. This is where you can get the code for the relevant post. I hope this helps, and thanks for your comment. Chris

  • @christianrazvan
    @christianrazvan Год назад

    But how you can deal with many rows? If you have many rows and you have to use that navigator ( redirect to ) the data has to be pulled from the server again. Any solution to just bring the newly inserted data?

    • @christopherbell7186
      @christopherbell7186  Год назад

      With this method of adding, or editing, (because we are navigating away from, and then back to "\countrylist\") I can't think of a way to keep the data for countrylist and then just amend for any changes. In part #8 where I show adding and editing data for cities I don't navigate away from the main Countries/Cities list page, but after the insert/edit I still refresh the grid by doing a refresh of the data for the grid. In this case I think it should be possible to keep the dataset and amend for inserts and edits - but it looks a bit tricky to me! (Especially the edit.) I think whether it would be worth the effort would depend on the number of records that needed to be refreshed from the server...

  • @atirah14
    @atirah14 Год назад

    The application is showing a server error. I'm new to this, so i'm not very well versed at debugging the application. So i decided to do it all over again. The application worked until Create, but when it came to the update part, i may have made a mistake somewhere, and i'm just unable to figure out where, so i decided to redo everything. This video, is the most difficult, in this series so far. It is also the longest. Christopher, thanks for making these videos. I have enrolled in many courses in Udemy, and also took iamtimcorey's c# masterclass. I still feel very lost.. is there light under the tunnel?

    • @christopherbell7186
      @christopherbell7186  Год назад

      Hi atriha14. Agreed, this is the longest, and probably most difficult video in this series, but it does contain the 'essentials' for understanding the way that Blazor WASM reads, writes and deletes data. I have a companion blog post that shows all the steps and not only has code in the blog post itself, but also a link to all code modified in this video. The link to the blog post is: blazorcode.uk/countriesandcitieswasm/crud-operations/ and the link to the code: blazorcode.uk/countriesandcitieswasm/crud-operations-code/ I always put a link to the blogpost in the video description and the link to the code is always at the bottom of the blog post. It's tempting just to copy and paste code, but I think you will learn more by typing out the code; it's tedious, but you will learn a lot more.
      Good luck, and don't give up!

    • @atirah14
      @atirah14 Год назад

      I have visited your website many times. I’ve read your posts. They are all very clear and well written just like your videos. Thanks.

  • @atirah14
    @atirah14 Год назад

    What is Cors. Does Cors cause the application to give errors?

    • @christopherbell7186
      @christopherbell7186  Год назад +1

      Hi atirah14. I'm not surprised you're feeling disheartened! I think you have stumbled upon a problem I haven't come across before, and CORS sounds like a bit of a nightmare to resolve.
      I use Microsoft Edge as my browser, (although I have also tested with Chrome, Firefox and Vivaldi - all seem to be OK for me.) Did you configure to use https when you originally created the project?
      These websites might be helpful - the Chrome addins might be the quickfix - but if they don't work I think you are in for some serious reading...
      learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-6.0#attr
      medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9
      Best wishes