Skip to content

Instantly share code, notes, and snippets.

@emrekizildas
Created March 19, 2019 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emrekizildas/0a5a1d96479c07824f6de3e3b5f5936f to your computer and use it in GitHub Desktop.
Save emrekizildas/0a5a1d96479c07824f6de3e3b5f5936f to your computer and use it in GitHub Desktop.
using System;
using Microsoft.EntityFrameworkCore;
namespace CoreAPI.Models
{
public class DatabaseContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseNpgsql("Host=localhost;Database=CoreAPIDb;Username=postgres;Password=1273");
public DbSet<Author> Authors { get; set; }
public DbSet<Book> Books { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment