CopyUSB/MyDB/FileInfoDb.cs

24 lines
554 B
C#
Raw Normal View History

2023-10-13 16:29:15 +00:00
using CopyUSB.MyDB.Class;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CopyUSB.MyDB;
public class FileInfoDb:DbContext
{
public FileInfoDb()
{
this.Database.EnsureCreated();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
/*base.OnConfiguring(optionsBuilder);*/
optionsBuilder.UseSqlite("Data Source=./fileInfo.db");
}
public DbSet<FileInfoTable> Files { get; set; }
}