1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc;
- using SqlSugar;
- using Wms.Screen.SqlSugar.ZhongTian;
- namespace Wms.Screen.Api.Controllers
- {
- /// <summary>
- /// sql sugar执行控制器
- /// </summary>
- [Route("api/[controller]")]
- [ApiController]
- public class DBController : ControllerBase
- {
- [HttpGet]
- public void Get()
- {
- SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
- {
- ConnectionString = "server=A2202042-01\\MSSQLSERVER01;user id=sa;password=Liyang1998;database=hjwms",
- DbType = DbType.SqlServer,
- IsAutoCloseConnection = true,
- InitKeyType = InitKeyType.Attribute
- });
- db.CodeFirst.InitTables();
- }
- }
- }
|