This file contains hidden or 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
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
loggerFactory.AddConsole(Configuration.GetSection("Logging")); | |
loggerFactory.AddDebug(); | |
app.UseApplicationInsightsRequestTelemetry(); | |
if (env.IsDevelopment()) | |
{ | |
app.UseBrowserLink(); |
This file contains hidden or 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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.Configure<AppSettings>(Configuration.GetSubKey("AppSettings")); | |
services.AddEntityFramework() | |
.AddSqlServer() | |
.AddDbContext<SchoolContext>(); | |
// Add MVC services to the services container. | |
services.AddMvc(); | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width"> | |
<base href="/" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" type="text/javascript"></script> | |
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> | |
<link href="css/site.css" rel="stylesheet" /> | |
</head> |
This file contains hidden or 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
<div> | |
<label>Summary: </label> | |
<select (change)="filterForeCasts($event.target.value)"> | |
<option value="0">--All--</option> | |
<option *ngFor="let summary of summaries" value={{summary}}> | |
{{summary}} | |
</option> | |
</select> | |
</div> |
This file contains hidden or 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
import { Component, Inject } from '@angular/core'; | |
import { Http } from '@angular/http'; | |
@Component({ | |
selector: 'fetchdata', | |
templateUrl: './fetchdata.component.html' | |
}) | |
export class FetchDataComponent { | |
public forecasts: WeatherForecast[]; | |
public cacheForecasts: WeatherForecast[]; |
This file contains hidden or 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
private static string[] Summaries = new[] | |
{ | |
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | |
}; | |
[HttpGet("[action]")] | |
public string[] GetSummaries() | |
{ | |
return Summaries; | |
} |
This file contains hidden or 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
@page "/anothertodo" | |
@using ASPNETBlazorCRUDApp.Shared | |
@inject HttpClient Http | |
<h1>ToDo List</h1> | |
<div> | |
<div class="row"> | |
<div class="col-sm-1"> | |
<p>Item:</p> |
This file contains hidden or 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
[Produces("application/json")] | |
[Route("api/ToDo")] | |
public class ToDoListController : Controller | |
{ | |
private readonly ToDoListContext _context; | |
public ToDoListController(ToDoListContext context) | |
{ | |
_context = context; | |
} |
This file contains hidden or 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
@page "/todo" | |
@using ASPNETBlazorCRUDApp.Shared | |
@using Microsoft.AspNetCore.Blazor.Browser.Interop | |
@inject HttpClient Http | |
<h1>ToDo List</h1> | |
<div> | |
<div class="row"> | |
<div class="col-sm-1"> |