Esempio n. 1
0
 public async Task ExecuteScalarAsync()
 {
     RequestContext context = new RequestContext
     {
         Scope = Scope,
         SqlId = "GetRecord"
     };
     var total = await _sqlMapper.ExecuteScalarAsync <long>(context);
 }
        public static Task <T> ExecuteScalarAsync <T>(this ISmartSqlMapper sqlMapper, string fullSqlId, dynamic @params)
        {
            EnsurePoint(ref fullSqlId);

            return(sqlMapper.ExecuteScalarAsync <T>(new RequestContext()
            {
                Scope = fullSqlId.Split('.')[0],
                SqlId = fullSqlId.Split('.')[1],
                Request = @params
            }));
        }
Esempio n. 3
0
        public long ExecuteScalarAsync()
        {
            RequestContext context = new RequestContext
            {
                Scope = Scope,
                SqlId = "GetRecord"
            };

            var total = _sqlMapper.ExecuteScalarAsync <long>(context).GetAwaiter().GetResult();

            return(total);
        }
Esempio n. 4
0
        public async Task <long> ExecuteScalarAsync()
        {
            RequestContext context = new RequestContext
            {
                Scope   = Scope,
                SqlId   = "GetRecord",
                Request = new { FStrings = new string[] { "SmartSql", "SmartCode" } }
            };

            var total = await _sqlMapper.ExecuteScalarAsync <long>(context);

            return(total);
        }
Esempio n. 5
0
 public Task <T> ExecuteScalarAsync <T>(RequestContext context)
 {
     return(MapperInstance.ExecuteScalarAsync <T>(context));
 }
Esempio n. 6
0
 public Task <T> ExecuteScalarAsync <T>(RequestContext context)
 {
     return(SqlMapper.ExecuteScalarAsync <T>(context));
 }