提交更新

This commit is contained in:
CortexCore
2023-07-12 15:27:27 +08:00
parent 4af7cec47b
commit 498b0617f8
13 changed files with 294 additions and 154 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Cysharp.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace BITKit;
@@ -8,7 +9,6 @@ namespace BITKit;
public class SqlLiteContext<T> : DbContext,IDatabaseContext<T> where T : class
{
public DbSet<T> context { get; private set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@@ -20,6 +20,12 @@ public class SqlLiteContext<T> : DbContext,IDatabaseContext<T> where T : class
context.Add(entity);
SaveChanges();
}
public UniTask AddAsync(T entity)
{
throw new NotImplementedException();
}
public virtual void Remove(T entity)
{
context.Remove(entity);