public ResponseResult Get([FromQuery] ConfigurationFilter filter)
        {
            ResponseResult result = new ResponseResult();

            var keyValues = new List <KeyValuePair <string, string> >();

            List <ConfigurationModel> configurations = _orm.GetSqlClient <SqlSugarClient>().GetSimpleClient <ConfigurationModel>().GetList(x => x.Environment == filter.Environment && (x.AppId == filter.AppId || x.AppId == "Common") && x.IsDelete == false);

            if (configurations == null)
            {
                result.Success = false;

                return(result);
            }

            foreach (ConfigurationModel configuration in configurations)
            {
                keyValues.Add(KeyValuePair.Create <string, string>(configuration.Key, configuration.Value));
            }

            result.Success = true;
            result.Data    = keyValues;


            return(result);
        }
Esempio n. 2
0
        public BaseRepository()
        {
            SetConnectionString();

            _orm = new SugarORM(_connectionString);

            _sugarClient = _orm.GetSqlClient <SqlSugarClient>();
        }
Esempio n. 3
0
 protected virtual T ORMClient <T>() where T : class
 {
     return(_orm.GetSqlClient <T>());
 }