Exemplo n.º 1
0
        public async Task <RCart> Get(string connectionString, string clientId, EnumDefine.CartStatusEnum status)
        {
            var data = await WithConnection(connectionString, async (connection) =>
            {
                DynamicParameters parameters = new DynamicParameters();
                parameters.Add("@ClientId", clientId, DbType.String);
                parameters.Add("@Status", status.AsEnumToInt(), DbType.Int64);
                return(await connection.QueryFirstOrDefaultAsync <RCart>(ProcName.ShoppingCart_GetByCustomer, parameters, commandType: CommandType.StoredProcedure));
            });

            return(data);
        }
Exemplo n.º 2
0
 public async Task <RCartItem[]> Get(string connectionString, string cartId, EnumDefine.CartStatusEnum status)
 {
     return(await WithConnection(connectionString, async (connection) =>
     {
         DynamicParameters parameters = new DynamicParameters();
         parameters.Add("@CartId", cartId, DbType.String);
         parameters.Add("@Status", status.AsEnumToInt(), DbType.Int64);
         parameters.Add("@AllStatus", EnumDefine.CartStatusEnum.AllStatus.AsEnumToInt(), DbType.Int64);
         var datas = await connection.QueryAsync <RCartItem>(ProcName.ShoppingCartItem_GetByCartId, parameters, null, null, CommandType.StoredProcedure);
         return datas.ToArray();
     }));
 }