Example #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
            }));
        }
Example #3
0
        public long ExecuteScalarAsync()
        {
            RequestContext context = new RequestContext
            {
                Scope = Scope,
                SqlId = "GetRecord"
            };

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

            return(total);
        }
        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);
        }
Example #5
0
 public Task <T> ExecuteScalarAsync <T>(RequestContext context)
 {
     return(MapperInstance.ExecuteScalarAsync <T>(context));
 }
Example #6
0
 public Task <T> ExecuteScalarAsync <T>(RequestContext context)
 {
     return(SqlMapper.ExecuteScalarAsync <T>(context));
 }