Exemplo n.º 1
0
 public async Task ExecuteScalarAsync()
 {
     RequestContext context = new RequestContext
     {
         Scope = Scope,
         SqlId = "GetRecord"
     };
     var total = await _sqlMapper.ExecuteScalarAsync <long>(context);
 }
Exemplo n.º 2
0
        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
            }));
        }
Exemplo n.º 3
0
        public long ExecuteScalarAsync()
        {
            RequestContext context = new RequestContext
            {
                Scope = Scope,
                SqlId = "GetRecord"
            };

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

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