Skip to content

Instantly share code, notes, and snippets.

View yostane's full-sized avatar

Yassine Benabbas yostane

View GitHub Profile
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
//add Razor Pages to the pipeline
app.UseMvc();
}
public void ConfigureServices(IServiceCollection services)
{
// Includes support for Razor Pages and controllers.
services.AddMvc();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
loggerFactory.AddConsole();
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>
<RuntimeIdentifiers>win10-x64;osx.10.11-x64</RuntimeIdentifiers>
using System;
namespace dotnet_core_tutorials
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
using System;
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace efcore_tuto_1 {
class Program {
static void Main (string[] args) {
Console.WriteLine ("Hello World Entity Framework Core!");
using (var context = new VideoGamesDatabaseContext ()) {
Hello World Entity Framework Core!
Current database content
Steins's Gate - PSVita - 0
Current database content
Steins's Gate - PSVita - 0
Final Fantasy XV - PS4 - 2016