SlideShare a Scribd company logo
1 of 7
Download to read offline
FOR MVC DEVLEOPERS THE FEAUTURES OF ASP.NET CORE
ASP.NET Core 1.0 gives a patched up Web development system adapted towards the prerequisites of
present day Web applications. The new structure, as of now in RC1, obliges you to learn numerous new
ideas not found in ASP.NET MVC 5. To that end, this article identifies a couple of essential
components that ASP.NET MVC 5 designers ought to know as they get ready to take in this new
structure.
1. ASP.NET Core on Numerous Runways
ASP.NET Core is a piece of .NET Core—another measured structure that backings numerous
stages.ASP.NET and the .NET framework are focused on towards the Windows stage. Then
again, ASP.NET Core is created to bolster various stages including Windows, Mac, and Linux.
This additionally implies, dissimilar to ASP.NET web applications, basically, keep running
under IIS, the ASP.NET Core applications can keep running under non-IIS Web servers.
Figure 1 demonstrates the part of the .NET Core and ASP.NET Core.
The part of the .NET Core and ASP.NET Core -
A Web application worked with ASP.NET Core can target ASP.NET Framework 4.6 or the
ASP.NET Core. The Web applications focusing on ASP.NET Framework 4.6 run just on the
Windows stage. The Web applications focusing on the ASP.NET Core can keep running on
Windows and non-Windows stages. Obviously, as on this composition, ASP.NET Core doesn't
offer the same rich usefulness offered by ASP.NET Framework 4.6.
2. Part of Project.json
ASP.NET Core utilizes an exceptional document—Project.json for putting away all the
undertaking level configuration data. Project.config can store numerous design settings, for
example, references to NuGet bundles utilized as a part of the task and target structures.
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Abstractions":
"1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json":
"1.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.AspNet.Session": "1.0.0-rc1-final",
"Newtonsoft.Json": "8.0.3"
The Project.json record stores configuration data in JSON position. The above markup
demonstrates a conditions segment that contains a rundown of NuGet bundles required by the
application. For instance, the Web application under thought requires the 6.0.0-rc1-last form of
Microsoft.AspNet.Mvc get together, etc
3. Part of AppSettings.json
ASP.NET stores application configuration settings in Web.config. For instance, engineers utilize
the <appSettings> area to store custom application settings, the <connectionStrings> segment to
store database association strings, etc. ASP.NET Core utilizes AppSettings.json to store such
bits of data.
Consider the accompanying configuration:
{
"AppSettings": {
"Title": "My ASP.NET Core Application"
},
"Data": {
"DefaultConnection": {
"ConnectionString": "data source=.;
initial catalog=Northwind;integrated security=true"
}
}
}
The previous JSON markup comprises of two properties or keys, to be specific AppSettings and
Data. The AppSettings property holds a sub-key named Title. The Title sub-key has a string
estimation of "My ASP.NET Core Application". Also, the Data key has a DefaultConnection
sub-key. The DefaultConnection thusly has a ConnectionString sub-key.
4. Application set-up
In ASP.NET, Global.asax goes about as the passage point for your application. You can wire
different events handlers for occasions, for example, Application_Start and Session_Start, in the
Global.asax record. In ASP.NET Core, the application startup happens in an unexpected way—
it happens through a Startup class.
one such Startup class -
public class Startup
{
public Startup(IHostingEnvironment env,
IApplicationEnvironment app)
{
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.SetBasePath(app.ApplicationBasePath);
builder.AddJsonFile("appsettings.json");
IConfigurationRoot config = builder.Build();
string str = config.Get<string>
("Data:DefaultConnection:ConnectionString");
// do something with str
}
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddEntityFramework()
.AddSqlServer();
}
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/
{action=Index}/{id?}");
});
}
public static void Main(string[] args) =>
WebApplication.Run<Startup>(args);
}
The Startup class appeared above starts with a constructor. The constructor stacks the
AppSettings.json record utilizing ConfigurationBuilder class. The Get() strategy then is utilized
to peruse the database association string put away in the AppSettings.json document.
The ConfigureServices() technique includes the administrations required by the application. For
instance, here you add MVC and Entity Framework to the administrations gathering.
The Configure() technique determines and arranges the administrations included before for
application's utilization. For instance, the MVC directing is designed in the code appeared
previously.
5. Tag Helpers
In ASP.NET MVC 5, you utilized HTML assistants, for example, BeginForm(), LabelFor(), and
TextBoxFor() to render structures and frame fields. You can keep on using HTML partners in
ASP.NET Core, too. However, there is a superior option: Tag Helpers. Label aides take the type
of standard HTML labels with certain extraordinary asp-* credits added to them.
Consider the accompanying markup that renders a structure:
<form asp-controller="Home" asp-action="Save" method="post">
<table border="1" cellpadding="10">
<tr>
<td><label asp-for="FirstName">First Name :</label></td>
<td><input type="text" asp-for="FirstName" /></td>
</tr>
<tr>
<td><label asp-for="LastName">Last Name :</label></td>
<td><input type="text" asp-for="LastName" /></td>
</tr>
<tr>
<td><label asp-for="Email">Email :</label></td>
<td><input type="text" asp-for="Email" /></td>
</tr>
<tr>
<td><label asp-for="Phone">Phone :</label></td>
<td><input type="text" asp-for="Phone" /></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
Observe clearly, the properties that start with asp-. They are characterized by the label aides.
For instance, the structure label aide utilizes asp-controller ascribe to indicate the objective
controller name and asp-activity credit to determine the objective activity technique name.
Correspondingly, asp-for traits utilized with name and info label partners tie a name or a text
box to a model property. Label partners are more advantageous to use than HTML assistants in
light of the fact that their linguistic structure nearly takes after the HTML markup.
6. View Components
In MVC 5, you utilized halfway perspectives as a way to reuse markup and code. ASP.NET
Core presents View Components, the more intense and adaptable option. A perspective part
comprises of a class normally acquired from ViewComponent base class and a perspective
record containing the required markup. This programming model is entirely like the one utilized
by controllers and perspectives. It permits you to separate code and markup from each other—
code in the perspective segment class and markup in a perspective. Once made, you can utilize
a perspective segment on a perspective by utilizing the @Component.Invoke() technique.
7. Dependency Injection
ASP.NET Core gives an inbuilt reliance infusion system. The DI system of ASP.NET Core
offers four-lifetime modes for a sort being infused:
Singleton: An object of an administration (the sort to be infused) is made and supplied to all the
requests to that administration. Along these lines, fundamentally all requests get the same article
to work with.
Scoped: An object of an administration is made for every single request. In this way, every
request gets another event of an administration to work with.
Transient: An object of an administration is made each time an article is asked.
Instance: For this situation, you are in charge of making an object of an administration. The DI
system then uses that case in singleton mode said prior
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton<IMyService,MyService>();
}
Here, MyService is the sort to be enlisted with the DI structure and actualizes IMyService. The
AddSingleton() technique enlists this type for Singleton mode portrayed previously. Once a sort
is enrolled with the DI system, you can infuse it in a controller like this:
public class HomeController : Controller
{
private IMyService obj;
public HomeController(IMyService obj)
{
this.obj = obj;
}
....
....
}
8. Gulp, Grunt, and Bower Support
Gulp and Grunt are JavaScript assignment runners. They help you computerize generally
required undertakings, for example, packaging JavaScript and CSS records, minifying
JavaScript and CSS documents, and arranging Less and Sass records (and some more). They are
introduced utilizing npm (Node Package Manager). The ASP.NET Core venture made utilizing
Visual Studio 2015 permits you to include Grunt and Gulp arrangement documents furthermore
gives Task Runner Explorer to screen the errands.
Bower is a bundle administrator basically for front-end bundles. Front-end bundles are the
bundles that you use in your Web pages, for example, JavaScript libraries/systems and CSS
records. For instance, you may introduce jQuery in your ASP.NET Core venture by utilizing
Bower. An ASP.NET Core venture made utilizing Visual Studio 2015 permits you to include a
Bower setup document. You likewise can work with the bundles utilizing the Manage Bower
Packages menu choice.
9. Single Programming for Web API Model for and MVC
In MVC 5, controllers acquire from the System.Web.Mvc.Controller base class. What's more,
Web API 2 controllers acquire from System.Web.Http.ApiController. In ASP.NET Core, both of
these structures are converged into a solitary system. Therefore, under ASP.NET Core, an MVC
controller and Web API controller both acquire from Microsoft.AspNet.Mvc.Controller base
class. You then can design viewpoints, for example, HTTP verb mapping and the directing of
the controllers as coveted.
10. Static Files and the wwwroot Folder
In ASP.NET, there is no settled area for putting away static documents, for example, picture
records, JavaScript documents, and CSS records (engineers regularly utilized a Content
envelope to store such documents). In ASP.NET Core, all the static records are kept under the
wwwroot envelope (default). You likewise can change the name of this envelope by utilizing the
Project.json document.
Refer the figure following down -
After arrangement, the wwwroot turns into the Web application's root. Every one of the URLs
to static records are determined as for this envelope. Along these lines,/pictures/logo.png
anticipates that logo.png will be available under the wwwroot/pictures envelope.
Conclusion -
ASP.NET Core 1.0 is a redone system outfitted towards present day cloud based, measured Web
applications. Despite the fact that the new structure safeguards the key ideas of MVC 5, ASP.NET
engineers will discover numerous contrasts between MVC 5 and ASP.NET Core 1.0. This article
specified the imperative new components/ideas that you have to comprehend to start your voyage with
ASP.NET Core 1.0.
We the institute provide training in dot net field to freshers to know the reviews
about our company visit crb tech reviews.
Related Articles:
8 Killer Techniques To Learn .NET
Top 5 Reasons That Make ASP.NET More Secure Over PHP

More Related Content

Viewers also liked

Viewers also liked (10)

Are timesheets money sheets by Frank Verleg
Are timesheets money sheets by Frank VerlegAre timesheets money sheets by Frank Verleg
Are timesheets money sheets by Frank Verleg
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
 
оаам л5
оаам л5оаам л5
оаам л5
 
BANCO CENTRAL - PMI Implantando uma Visão Integrada de Gestão
BANCO CENTRAL - PMI Implantando uma Visão Integrada de GestãoBANCO CENTRAL - PMI Implantando uma Visão Integrada de Gestão
BANCO CENTRAL - PMI Implantando uma Visão Integrada de Gestão
 
Проект "Чорнобривці - квіти сонця"
Проект "Чорнобривці - квіти сонця"Проект "Чорнобривці - квіти сонця"
Проект "Чорнобривці - квіти сонця"
 
Academy PRO: ASP .NET Core MVC
Academy PRO: ASP .NET Core MVCAcademy PRO: ASP .NET Core MVC
Academy PRO: ASP .NET Core MVC
 
ScaleUp Airbnb - จับเสือมือเปล่า
ScaleUp Airbnb - จับเสือมือเปล่าScaleUp Airbnb - จับเสือมือเปล่า
ScaleUp Airbnb - จับเสือมือเปล่า
 
การพัฒนาคุณภาพจากการทบทวน
การพัฒนาคุณภาพจากการทบทวนการพัฒนาคุณภาพจากการทบทวน
การพัฒนาคุณภาพจากการทบทวน
 
Human values &amp; professional ethics bm 226
Human values &amp; professional ethics bm 226Human values &amp; professional ethics bm 226
Human values &amp; professional ethics bm 226
 
pi936.pdf
pi936.pdfpi936.pdf
pi936.pdf
 

More from sonia merchant

More from sonia merchant (20)

What does dot net hold for 2016?
What does dot net hold for 2016?What does dot net hold for 2016?
What does dot net hold for 2016?
 
What does .net hold for 2016?
What does .net hold for 2016?What does .net hold for 2016?
What does .net hold for 2016?
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot net
 
Authorization p iv
Authorization p ivAuthorization p iv
Authorization p iv
 
Authorization iii
Authorization iiiAuthorization iii
Authorization iii
 
Authorization in asp dot net part 2
Authorization in asp dot net part 2Authorization in asp dot net part 2
Authorization in asp dot net part 2
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
 
Search page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-netSearch page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-net
 
Build a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-netBuild a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-net
 
How to optimize asp dot-net application
How to optimize asp dot-net applicationHow to optimize asp dot-net application
How to optimize asp dot-net application
 
How to optimize asp dot net application ?
How to optimize asp dot net application ?How to optimize asp dot net application ?
How to optimize asp dot net application ?
 
10 things to remember
10 things to remember10 things to remember
10 things to remember
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
 
Learn about dot net attributes
Learn about dot net attributesLearn about dot net attributes
Learn about dot net attributes
 
Owin and-katana-overview
Owin and-katana-overviewOwin and-katana-overview
Owin and-katana-overview
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
 
Next generation asp.net v next
Next generation asp.net v nextNext generation asp.net v next
Next generation asp.net v next
 
Dot net universal apps
Dot net universal appsDot net universal apps
Dot net universal apps
 
Browser frame building with c# and vb dot net
Browser frame building  with c# and vb dot netBrowser frame building  with c# and vb dot net
Browser frame building with c# and vb dot net
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-frameworkA simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-framework
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
Envelope of Discrepancy in Orthodontics: Enhancing Precision in Treatment
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 

For mvc developers the features of asp.net core

  • 1. FOR MVC DEVLEOPERS THE FEAUTURES OF ASP.NET CORE ASP.NET Core 1.0 gives a patched up Web development system adapted towards the prerequisites of present day Web applications. The new structure, as of now in RC1, obliges you to learn numerous new ideas not found in ASP.NET MVC 5. To that end, this article identifies a couple of essential components that ASP.NET MVC 5 designers ought to know as they get ready to take in this new structure. 1. ASP.NET Core on Numerous Runways ASP.NET Core is a piece of .NET Core—another measured structure that backings numerous stages.ASP.NET and the .NET framework are focused on towards the Windows stage. Then again, ASP.NET Core is created to bolster various stages including Windows, Mac, and Linux. This additionally implies, dissimilar to ASP.NET web applications, basically, keep running under IIS, the ASP.NET Core applications can keep running under non-IIS Web servers. Figure 1 demonstrates the part of the .NET Core and ASP.NET Core.
  • 2. The part of the .NET Core and ASP.NET Core - A Web application worked with ASP.NET Core can target ASP.NET Framework 4.6 or the ASP.NET Core. The Web applications focusing on ASP.NET Framework 4.6 run just on the Windows stage. The Web applications focusing on the ASP.NET Core can keep running on Windows and non-Windows stages. Obviously, as on this composition, ASP.NET Core doesn't offer the same rich usefulness offered by ASP.NET Framework 4.6. 2. Part of Project.json ASP.NET Core utilizes an exceptional document—Project.json for putting away all the undertaking level configuration data. Project.config can store numerous design settings, for example, references to NuGet bundles utilized as a part of the task and target structures. "dependencies": { "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", "EntityFramework.Commands": "7.0.0-rc1-final", "Microsoft.AspNet.Session": "1.0.0-rc1-final", "Newtonsoft.Json": "8.0.3" The Project.json record stores configuration data in JSON position. The above markup demonstrates a conditions segment that contains a rundown of NuGet bundles required by the application. For instance, the Web application under thought requires the 6.0.0-rc1-last form of Microsoft.AspNet.Mvc get together, etc 3. Part of AppSettings.json ASP.NET stores application configuration settings in Web.config. For instance, engineers utilize the <appSettings> area to store custom application settings, the <connectionStrings> segment to store database association strings, etc. ASP.NET Core utilizes AppSettings.json to store such bits of data. Consider the accompanying configuration: { "AppSettings": { "Title": "My ASP.NET Core Application" },
  • 3. "Data": { "DefaultConnection": { "ConnectionString": "data source=.; initial catalog=Northwind;integrated security=true" } } } The previous JSON markup comprises of two properties or keys, to be specific AppSettings and Data. The AppSettings property holds a sub-key named Title. The Title sub-key has a string estimation of "My ASP.NET Core Application". Also, the Data key has a DefaultConnection sub-key. The DefaultConnection thusly has a ConnectionString sub-key. 4. Application set-up In ASP.NET, Global.asax goes about as the passage point for your application. You can wire different events handlers for occasions, for example, Application_Start and Session_Start, in the Global.asax record. In ASP.NET Core, the application startup happens in an unexpected way— it happens through a Startup class. one such Startup class - public class Startup { public Startup(IHostingEnvironment env, IApplicationEnvironment app) { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.SetBasePath(app.ApplicationBasePath); builder.AddJsonFile("appsettings.json"); IConfigurationRoot config = builder.Build(); string str = config.Get<string> ("Data:DefaultConnection:ConnectionString"); // do something with str } public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddEntityFramework() .AddSqlServer(); } public void Configure(IApplicationBuilder app) { app.UseStaticFiles(); app.UseMvc(routes =>
  • 4. { routes.MapRoute( name: "default", template: "{controller=Home}/ {action=Index}/{id?}"); }); } public static void Main(string[] args) => WebApplication.Run<Startup>(args); } The Startup class appeared above starts with a constructor. The constructor stacks the AppSettings.json record utilizing ConfigurationBuilder class. The Get() strategy then is utilized to peruse the database association string put away in the AppSettings.json document. The ConfigureServices() technique includes the administrations required by the application. For instance, here you add MVC and Entity Framework to the administrations gathering. The Configure() technique determines and arranges the administrations included before for application's utilization. For instance, the MVC directing is designed in the code appeared previously. 5. Tag Helpers In ASP.NET MVC 5, you utilized HTML assistants, for example, BeginForm(), LabelFor(), and TextBoxFor() to render structures and frame fields. You can keep on using HTML partners in ASP.NET Core, too. However, there is a superior option: Tag Helpers. Label aides take the type of standard HTML labels with certain extraordinary asp-* credits added to them. Consider the accompanying markup that renders a structure: <form asp-controller="Home" asp-action="Save" method="post"> <table border="1" cellpadding="10"> <tr> <td><label asp-for="FirstName">First Name :</label></td> <td><input type="text" asp-for="FirstName" /></td> </tr> <tr> <td><label asp-for="LastName">Last Name :</label></td> <td><input type="text" asp-for="LastName" /></td> </tr> <tr> <td><label asp-for="Email">Email :</label></td> <td><input type="text" asp-for="Email" /></td>
  • 5. </tr> <tr> <td><label asp-for="Phone">Phone :</label></td> <td><input type="text" asp-for="Phone" /></td> </tr> <tr> <td colspan="2"> <input type="submit" value="Submit" /> </td> </tr> </table> </form> Observe clearly, the properties that start with asp-. They are characterized by the label aides. For instance, the structure label aide utilizes asp-controller ascribe to indicate the objective controller name and asp-activity credit to determine the objective activity technique name. Correspondingly, asp-for traits utilized with name and info label partners tie a name or a text box to a model property. Label partners are more advantageous to use than HTML assistants in light of the fact that their linguistic structure nearly takes after the HTML markup. 6. View Components In MVC 5, you utilized halfway perspectives as a way to reuse markup and code. ASP.NET Core presents View Components, the more intense and adaptable option. A perspective part comprises of a class normally acquired from ViewComponent base class and a perspective record containing the required markup. This programming model is entirely like the one utilized by controllers and perspectives. It permits you to separate code and markup from each other— code in the perspective segment class and markup in a perspective. Once made, you can utilize a perspective segment on a perspective by utilizing the @Component.Invoke() technique. 7. Dependency Injection ASP.NET Core gives an inbuilt reliance infusion system. The DI system of ASP.NET Core offers four-lifetime modes for a sort being infused: Singleton: An object of an administration (the sort to be infused) is made and supplied to all the requests to that administration. Along these lines, fundamentally all requests get the same article to work with. Scoped: An object of an administration is made for every single request. In this way, every request gets another event of an administration to work with. Transient: An object of an administration is made each time an article is asked. Instance: For this situation, you are in charge of making an object of an administration. The DI system then uses that case in singleton mode said prior public void ConfigureServices(IServiceCollection services)
  • 6. { services.AddMvc(); services.AddSingleton<IMyService,MyService>(); } Here, MyService is the sort to be enlisted with the DI structure and actualizes IMyService. The AddSingleton() technique enlists this type for Singleton mode portrayed previously. Once a sort is enrolled with the DI system, you can infuse it in a controller like this: public class HomeController : Controller { private IMyService obj; public HomeController(IMyService obj) { this.obj = obj; } .... .... } 8. Gulp, Grunt, and Bower Support Gulp and Grunt are JavaScript assignment runners. They help you computerize generally required undertakings, for example, packaging JavaScript and CSS records, minifying JavaScript and CSS documents, and arranging Less and Sass records (and some more). They are introduced utilizing npm (Node Package Manager). The ASP.NET Core venture made utilizing Visual Studio 2015 permits you to include Grunt and Gulp arrangement documents furthermore gives Task Runner Explorer to screen the errands. Bower is a bundle administrator basically for front-end bundles. Front-end bundles are the bundles that you use in your Web pages, for example, JavaScript libraries/systems and CSS records. For instance, you may introduce jQuery in your ASP.NET Core venture by utilizing Bower. An ASP.NET Core venture made utilizing Visual Studio 2015 permits you to include a Bower setup document. You likewise can work with the bundles utilizing the Manage Bower Packages menu choice. 9. Single Programming for Web API Model for and MVC In MVC 5, controllers acquire from the System.Web.Mvc.Controller base class. What's more, Web API 2 controllers acquire from System.Web.Http.ApiController. In ASP.NET Core, both of these structures are converged into a solitary system. Therefore, under ASP.NET Core, an MVC controller and Web API controller both acquire from Microsoft.AspNet.Mvc.Controller base class. You then can design viewpoints, for example, HTTP verb mapping and the directing of the controllers as coveted. 10. Static Files and the wwwroot Folder
  • 7. In ASP.NET, there is no settled area for putting away static documents, for example, picture records, JavaScript documents, and CSS records (engineers regularly utilized a Content envelope to store such documents). In ASP.NET Core, all the static records are kept under the wwwroot envelope (default). You likewise can change the name of this envelope by utilizing the Project.json document. Refer the figure following down - After arrangement, the wwwroot turns into the Web application's root. Every one of the URLs to static records are determined as for this envelope. Along these lines,/pictures/logo.png anticipates that logo.png will be available under the wwwroot/pictures envelope. Conclusion - ASP.NET Core 1.0 is a redone system outfitted towards present day cloud based, measured Web applications. Despite the fact that the new structure safeguards the key ideas of MVC 5, ASP.NET engineers will discover numerous contrasts between MVC 5 and ASP.NET Core 1.0. This article specified the imperative new components/ideas that you have to comprehend to start your voyage with ASP.NET Core 1.0. We the institute provide training in dot net field to freshers to know the reviews about our company visit crb tech reviews. Related Articles: 8 Killer Techniques To Learn .NET Top 5 Reasons That Make ASP.NET More Secure Over PHP