Пример #1
0
        protected async override Task <Sqless> GetSqless(SqlessRequest request)
        {
            var uid = await SqlessAccess.GetUid(request.AccessParams);

            SqlessConfig.AuthUid = uid;
            return(new Sqless(SqlessConfig));
        }
Пример #2
0
        public static async Task <T> Post <T>(SqlessRequest request, SqlessApiType sqlessApiType)
        {
            var res = await HttpClient.PostAsync("sqless/" + sqlessApiType.ToString(), request);

            if (!res.IsSuccessStatusCode)
            {
                throw new SqlessRequestException(res, await res.GetErrorMessage());
            }
            return(await res.GetContent <T>());
        }
Пример #3
0
 protected virtual Task <Sqless> GetSqless(SqlessRequest request)
 {
     return(Task.FromResult(new Sqless(SqlessConfig)));
 }
Пример #4
0
 /// <summary>
 /// (insure connection is opened)
 /// </summary>
 /// <param name="sqless">sqless instance</param>
 /// <param name="request">sqless request</param>
 /// <param name="auth">readable or writable</param>
 protected SqlessSqlBuilder(Sqless sqless, SqlessRequest request, SqlessAuth auth)
 {
     Sqless        = sqless;
     SqlessRequest = request;
     Auth          = auth;
 }