You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
854 B
35 lines
854 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Entities;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
namespace DbContextLib
|
|
{
|
|
public class LibraryContext : DbContext
|
|
{
|
|
public DbSet<PersonEntity> PersonSet { get; set; }
|
|
public DbSet<BookEntity> BooksSet { get; set; }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
optionsBuilder.UseSqlite("Data Source=tp.Books.db");
|
|
}
|
|
}
|
|
|
|
public LibraryContext()
|
|
{ }
|
|
public LibraryContext(DbContextOptions <LibraryContext> options )
|
|
: base(options)
|
|
{ }
|
|
|
|
|
|
}
|
|
}
|