Created
February 1, 2020 16:40
-
-
Save CoreProgramm/e14e723b390cab21b98b1d1a8a46ce7b to your computer and use it in GitHub Desktop.
Difference between AddSingleton vs AddScoped vs AddTransient in asp.net core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Mobile | |
@inject IMobileService mobiledata | |
@{ | |
ViewData["Title"] = "Create"; | |
} | |
<form asp-controller="home" asp-action="create" method="post"> | |
<div> | |
<label asp-for="name"></label> | |
<div> | |
<input asp-for="name"> | |
</div> | |
</div> | |
<div> | |
<label asp-for="model"></label> | |
<div> | |
<input asp-for="model"> | |
</div> | |
</div> | |
<div> | |
<label asp-for="price"></label> | |
<div> | |
<input asp-for="price"> | |
</div> | |
</div> | |
<div> | |
<button type="submit">Create</button> | |
</div> | |
<div> | |
Total Employees Count = @mobiledata.GetAll().Count().ToString() | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment