Created
September 18, 2018 15:47
-
-
Save cpanuphan/e7399f2ade3af182203d01fd5bfc31df to your computer and use it in GitHub Desktop.
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using TodoApi.Models; | |
namespace TodoApi | |
{ | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddDbContext<TodoContext>(opt => | |
opt.UseSqlite("Data Source=TodoList.db")); | |
services.AddMvc() | |
.SetCompatibilityVersion(CompatibilityVersion.Version_2_1); | |
} | |
public void Configure(IApplicationBuilder app) | |
{ | |
app.UseMvc(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment