Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                         .SetBasePath(Directory.GetCurrentDirectory())
                         .AddJsonFile("appsettings.json", true, true)
                         .AddJsonFile("appsettings.Development.json", true, true)
                         .Build();

            var db = new HiLoContext(dbContextOptionBuilder.UseSqlServer(config.GetConnectionString("HiLoConnection")).Options);

            //db.Users.Add(new User() { Name = "Hua", CreateTime = DateTime.Now });
            //db.VipUsers.Add(new VipUser() { Name = "w", CreateTime = DateTime.Now });
            //db.SaveChanges();
        }
 public UserService(HiLoContext db)
 {
     _db = db;
 }
Exemplo n.º 3
0
 public UsersController(HiLoContext context)
 {
     _context = context;
 }