locked
Blazor - Should I used the OOP Approach on Blazor? RRS feed

  • Question

  • User1025857190 posted

    Good Day Everyone

    As I learned in ASP.NET Core tutorial form Kudvenkat in youtube, and also learning Blazor from his page, I just want to ask if I didn't want to do the webapi approached in Blazor, and I want to set my own CRUD inside blazor, Can I also do the OOP(Interface and SqlRepository) on Blazor? actually I'm trying to get it done on Blazor, but I'm having this errors, specially when I'm putting a constructor in partial class, is this possible?

    thanks everyone

    Wednesday, March 3, 2021 12:44 PM

Answers

  • User2041008840 posted

    If you are using  Blazor WASM go with WebApi. then make services in Blazor Client to call webapi endpoint into it. 

    As per your question, You are making process complex. Blazor makes web development more easy and robust. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 7, 2021 7:59 AM

All replies

  • User475983607 posted

    You did not provide any code, explained how the application works, or shared what version of Blazor you are using.  If this is a WASM application then more than likely you need Web API or some other service running on a server to invoke CRUD operation on a remote data store.  

    Can I also do the OOP(Interface and SqlRepository) on Blazor?

    Yes.  C# is an object oriented language.  However, a repository pattern is often an antipattern.  A better approach is a service pattern.

    but I'm having this errors, specially when I'm putting a constructor in partial class, is this possible?

    We cannot see your code and you did not provide the error.  We can only guess what programming problems you are experiencing. 

    Wednesday, March 3, 2021 12:57 PM
  • User379720387 posted

    Have you looked at Dapper?

    https://www.youtube.com/watch?v=8DNgdphLvag

    Sunday, March 7, 2021 4:31 AM
  • User2041008840 posted

    If you are using  Blazor WASM go with WebApi. then make services in Blazor Client to call webapi endpoint into it. 

    As per your question, You are making process complex. Blazor makes web development more easy and robust. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 7, 2021 7:59 AM