mikebrind / bakery Goto Github PK
View Code? Open in Web Editor NEWThe Original ASP.NET Web Pages Bakery Template
The Original ASP.NET Web Pages Bakery Template
public IndexModel(ChallisContext db) => this.db = db;
public List<Product> Products { get; set; } = new List<Product>();
public Product FeaturedProduct { get; set; }
public async Task OnGet()
{
Products = await db.Products.ToListAsync();
FeaturedProduct = Products.ElementAt(new Random().Next(Products.Count));
}
}
}
I was referred here by your Razor pages tutorial on line. On the page Adding Your First Page I get an error. I'm using .Net Core 3.1.201 with VS Code 1.44.1. This looks great but I've found a few differences and I come to a dead stop when trying to build the app after adding the About page. "The type or namespace name 'AboutModel' does not exist in the namespace 'Bakery.Pages' (are you missing an assembly reference?) [Bakery]".
The problem is obviously the line @model Bakery.Pages.AboutModel but, as a beginner, I have no idea how to create the missing file or reference. Can you help?
public IndexModel(ChallisContext db) => this.db = db;
public List<Product> Products { get; set; } = new List<Product>();
public Product FeaturedProduct { get; set; }
public async Task OnGet()
{
Products = await db.Products.ToListAsync();
FeaturedProduct = Products.ElementAt(new Random().Next(Products.Count));
}
}
}
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.