XFDbContext.cs 883 B

12345678910111213141516171819202122232425262728
  1. using Microsoft.EntityFrameworkCore;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using Winsoft.GOV.XF.WebApi.WXCore.Models;
  7. namespace Winsoft.GOV.XF.WebApi.WXCore.Data
  8. {
  9. public class XFDbContext: DbContext
  10. {
  11. public XFDbContext(DbContextOptions<XFDbContext> options) : base(options)
  12. {
  13. }
  14. public DbSet<WXUser> WXUsers { get; set; }
  15. public DbSet<Asset> Assets { get; set; }
  16. public DbSet<Bundle> Bundles { get; set; }
  17. protected override void OnModelCreating(ModelBuilder modelBuilder)
  18. {
  19. modelBuilder.Entity<WXUser>().ToTable("WXUser");
  20. modelBuilder.Entity<Asset>().ToTable("Asset");
  21. modelBuilder.Entity<Bundle>().ToTable("Bundle");
  22. base.OnModelCreating(modelBuilder);
  23. }
  24. }
  25. }