Connor
❔ How to achieve databinding with render fragments? If at all possible
I know components are a little more suited for this, but this is something I really want to be able to do.
I want to be able to use this on a page but as a renderfragment.
Currently only Test3 "works". It appears as if the references to the
str
in Test1 and Test2 are lost. It would be best if I could put the <input/>
directly in the RenderFragment and just bind the value to it but I had to create a component to show that it works with ValueChanged4 replies
❔ Is there any way to test the rendering of a component in Blazor based on different screen sizes?
I have a component that renders a table. It will render a different amount of rows based on screen size (Width < 800px). Is there any way for me to simulate adjusting screen size in BUnit? Couldn’t find any information online about it
2 replies
✅ Can you add related data to a DbContext like this
I have these classes where Company.Locations navigates to a Locations table and Location.LocationReviews navigates to a LocationReviews table
I have a generic controller that Im now finding out only works for Company entities.
31 replies
❔ How to deal with property’s that need data from a database?
I have a Blazor page where I want to display a Company’s rating which is the average of its location ratings. The problem is, I only store the locationIds on the company, not all the data. The best, botched solution I’ve come up with is doing company.Rating = company.GetRating() on initialization (I need the mongo service from the Blazor page to even get it); I can’t remove the Rating property because you can put as async method in html.
I feel like a better solution might lie in Lazy initialization or something. I really don’t know though, hence why I’m here.
I’m also currently “cluttering” the db of Companies with a Rating property that is always 0 (I get it on demand)
2 replies