web analytics

ASP.NET Core Introduction

Options
@2021-10-24 21:03:38

AppSettings.json

ASP.NET stores application configuration settings in Web.config. For example, developers use the <appSettings> section to store custom application settings, the <connectionStrings> section to store database connection strings, and so on. ASP.NET Core uses AppSettings.json to store such pieces of information. Consider the following configuration:

{
   "AppSettings": {
      "Title": "My ASP.NET Core Application"
   },

   "Data": {
      "DefaultConnection": {
         "ConnectionString": "data source=.;
            initial catalog=Northwind;integrated security=true"
      }
   }
}

The preceding JSON markup consists of two properties or keys, namely AppSettings and Data. The AppSettings property holds a sub-key named Title. The Title sub-key has a string value of “My ASP.NET Core Application”. Similarly, the Data key has a DefaultConnection sub-key. The DefaultConnection in turn has a ConnectionString sub-key.

You can read the values stored in AppSettings.json using ConfigurationBuilder and IConfiguration.

@2022-04-03 20:38:34

To set a location for web root, you add the following key and valus in the AppSettings.json file in the application root folder. 

{
  "webRoot": "c:\\temp\\wwwroot\\"
}
@2022-05-20 21:50:38

A Razor component is the combination of markup (written in HTML) and logic (in C#) in a single Razor file (with the .cshtml extension).

@2022-05-20 22:01:02

ASP.NET Core is a modern Web framework for .NET and includes everything you need to build beautiful Web UIs and powerful back-end services.
ith ASP.NET Core, you can build dynamic server-rendered UIs using MVC or Razor Pages. You can integrate ASP.NET Core with popular JavaScript frameworks or you can build rich interactive client Web UIs completely in .NET using Blazor. For services, you can use ASP.NET Core to build standards-based HTTP APIs, real-time services with SignalR, or high-performance back-end services with gRPC.

ASP.NET Core provides a flexible hosting model, high performance servers, and a rich set of built-in middleware to handle cross-cutting concerns like localization and security. No matter what kind of Web, server, or cloud app you're trying to build, ASP.NET Core offers a complete and fully integrated solution.

Comments

You must Sign In to comment on this topic.


© 2022 Digcode.com