Blazor, like most systems for generating Web pages, supports using layout pages for repeated content. Here's what works, what doesn't (yet) work and work-arounds I've discovered for what doesn't work.
The reality is that you will need to have, at least, two different configurations: one for production and one for development. Here's how to automate those conversions.
If you move beyond the basics of working with Razor Pages, there are at least two things you should know to support creating Pages that do more than one thing and integrate with existing code.
If you're moving your application's client-side code to Blazor, then you'll want Blazor to manage navigating between pages, too.
.NET Core 3.0 won't be ready for Visual Studio 2019's April 2 ship date, but a manual download and a menu configuration setting will let you use both previews together right now.
There are lots of ways to handle databases in a containerized environment like Docker. Here's how to create SQL Server in a container, how to load it with the data you want and how to integrate that container into whatever project needs it. Be warned: Some PowerShell is used.
Here's how to run a "real-world" application (consisting of an MVC application and a Web Service) in a networked set of Docker containers. And it's just a couple of mouse clicks in Visual Studio to implement it.
Our resident doctor of data science this month tackles anomaly detection, using code samples and screenshots to explain the process of finding rare items in a dataset, such as discovering fraudulent login events or fake news items.
- By James McCaffrey
- 03/04/2019
The Data Science doctor delves into supporting vector machines, software systems that can perform binary classification such as creating a model to predict the gender of a person based on their age, annual income, height and weight.
- By James McCaffrey
- 03/04/2019
If you want to handle the most common pattern in ASP.NET Controllers (displaying a page and then accepting data entered into it), you can do it with Razor Pages. You'll just need less code than if you used a Controller, a View and a model object.
As fond as he is of using Controllers and Views, Peter isn't sure that Razor Pages aren't a better model for Web development. But the first step, adding Razor Pages to your project, isn't as easy as it should be. And, after that, you'll want to integrate them with your existing MVC application.
In ASP.NET Core, your web.config file with its <appsettings> section is gone. The replacement is a more extensive and configurable system that you can leverage to simplify configuring your objects.
There are good reasons to keep working with Blazor 0.8.0.0 ... but you're going to need to make some changes.
ASP.NET Core's support for sharing objects defined at startup is great ... but what if you need to set options on those objects? Here's a case study that starts off great and then descends into over-engineered madness (but only if you want to go that far).
If you want to treat your database design as an "implementation detail" that just falls out of getting your object model right, then Entity Framework gives you four choices. Picking the right one, however, may mean creating your own.
ASP.NET Core makes building RESTful services easy and comfortable, says Joydip Kanjilal, who shows how to do just that in this article, complete with code samples and screenshots.
- By Joydip Kanjilal
- 02/05/2019
Eric Vogel uses code samples and screenshots to demonstrate how to create and use the views and controller for an ASP.NET MVC Core CRUD application.
Dr. James McCaffrey of Microsoft Research uses a full project code sample and screenshots to detail how to use Python to work with self-organizing maps (SOM), which let you investigate the structure of a set of data.
- By James McCaffrey
- 01/15/2019
Not only can you integrate JavaScript with Blazor, that integration provides a strategy for moving your existing pages to Blazor without having to rewrite your existing JavaScript code.
If someone tells you that LINQ doesn't support subqueries ... well, they're not wrong. But they're also not entirely correct, either. With LINQ you can meet many of the goals of SQL subqueries including the ability to build complex queries out of simpler ones.
Blazor expert Chris Sainty provides hands-on code samples to explain how to handle DOM and user-defined events in Microsoft's experimental project for writing browser-based apps with C# instead of JavaScript.
- By Chris Sainty
- 10/31/2018
ASP.NET Web API and ASP.NET MVC have similar (but not identical) mechanisms that allow you to customize how your requests and responses are processed. Not surprisingly, ASP.NET Web API's implementation is both easier and more flexible than ASP.NET MVC.
You have at least two options for adding processing to multiple controllers without duplicating code in each of the Controllers.
The Data Science Doctor explains how to use the reinforcement learning branch of machine learning with the Q-learning approach, providing code on how to solve a maze problem for an easy-to-understand example.
- By James McCaffrey
- 10/19/2018
Eric Vogel shows how to create a new ASP.NET Core Web application using Visual Studio 2017.