| | |
| | | using SqlSugar; |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | |
| | | namespace MES.Service.DB; |
| | | |
| | | public class Repository<T> : SimpleClient<T> where T : class, new() |
| | | { |
| | | public static SqlSugarScope Db = new(new ConnectionConfig |
| | | protected static SqlSugarScope Db = new(new ConnectionConfig |
| | | { |
| | | DbType = DbType.Oracle, |
| | | ConnectionString = |
| | | @"Data Source = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.251)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = ORCL))); Persist Security Info=True;User ID = sg_prd; Password=sgprd", |
| | | ConnectionString = AppsettingsUtility.Settings.DataBaseConn, |
| | | IsAutoCloseConnection = true |
| | | }, |
| | | db => |
| | |
| | | if (context == null) Context = Db; |
| | | } |
| | | |
| | | public int UseTransaction(Func<SqlSugarScope, int> action) |
| | | protected int UseTransaction(Func<SqlSugarScope, int> action) |
| | | { |
| | | try |
| | | { |