- Gist referenced in the videos
13 part series
License: MIT License
13 part series
how to resolve possible null reference return in GetProducts
I'm following along the videos for this tutorial. I created a new project using Visual Studio 2022. When I copied the contents of JsonFileProductService.cs into my project, this file had a compiler warning #CS8603, "Possible null reference return" on line 28, specifically the part that uses jsonFileReader.ReadToEnd()
. At this point, I have a few options:
<Nullable>enable</Nullable>
line from the default csproj file. Notice that this project does not include a Nullable line in it's csproj.#pragma warning disable CS8603 // Possible null reference return.
return JsonSerializer.Deserialize<Product[]>(jsonFileReader.ReadToEnd(), new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
});
#pragma warning restore CS8603 // Possible null reference return.
I think the correct call is to remove the nullable line from the csproj, because that will make my code look more like the code in this repo.
in the ProductList.razor when I try to get selectedProduct it says that it is not found
can any of you tell me where it exists
JsonFileProductService.cs includes a reference that does not match this video. This makes the solution not recognize the Product class in Models. Change using "ContosoCrafts.Website.Models" to using "Contoso.Models" to fix it.
I had trouble making the cards show up in more than one column. I went through the Bootstrap files inside lib/bootstrap/dist/css and I couldn't find the .card-coulmns class. So I went to the Bootstrap documentation and found a different way to make the columns: https://getbootstrap.com/docs/5.1/components/card/#grid-cards ; https://getbootstrap.com/docs/5.1/layout/grid/#row-columns. Basically we use row-cols classes to define a grid.
That's the solution that worked for me.
It seems the https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css font for the stars rating system does not work.
My question is for other things , i know you use ESC_POS_USB_NET, i need to know how to do you do the imagen more small size adding space before and after.
Can you help me thx!
Hi, I follow the tutorial and blocking on the popup window step.
I completely copy the code of ProductList.razor to avoid any typos and still can't pop up the window when click "More Info".
I have switched different browser, and make sure the browser did not block the popup window.
And of course there is no error message.
Furthermore, my main layout is different as the tutorials'. On my side, the main page only display one line with one product. I don't have serval products displayed in one line as showed in the YouTube.
I am bit of doubt about bootstrap version problem? I use 5.1.3.
Let me know, thanks.
app.MapGet("/products", (context) =>
{
IEnumerable products = app.Services.GetService().GetProducts();
var json = JsonSerializer.Serialize<IEnumerable>(products);
return context.Response.WriteAsync(json);
});
In video 5 of the tutorial ("Data in a Razor Page"), Scott promised there would be gists in the README. Where are they?
The img files referenced in products.json seem to be unavailable.
When clicking the "More Info" button in the completed project, the div.modal
does not appear. This happens in Edge (Chrome), Chrome, and Firefox. A second click on "More Info" shows the box.
class=”navbar-toggleable-sm” does not exist in Bootstrap, css.
Toggler-button does not always work: my long menu stretches out longer than the navigation
scr_menuProblem.pdf
bar, header, body and footer (longer than container's/page's width). It is true for ContosoCrafts and any Asp.Net Core web app template.
In Chrome toggler-button appears, when I re-size to minimum browser window width, in Edge – not at all.
The same is on a phone.
See attached screen-shots, my https://www.violetHeathDesign.com
Any suggestions, please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.