using EC.Service.Config; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Threading.Tasks; namespace EC.Service.CameraInfo { public partial class BaseDbContext : DbContext where T : class { public BaseDbContext() { } public BaseDbContext(DbContextOptions> options) : base(options) { } public virtual DbSet Infos { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { optionsBuilder.UseSqlite(ConfigHelper.GetDbConnection()); } } protected void OnModelCreatingPartial(ModelBuilder modelBuilder) { } #region Select public Task> GetListAsync() { Task> task = Task.Run(() => { return new List(Infos); }); return task; } #endregion Select } }