示例#1
0
        internal static async Task <int> PagingCountWithTestimonials(string site)
        {
            await using var cmd = new SqlCommand("[dbo].[GetWorksPagingWithTestimonialsReturnCount]", new Base().SqlConnection)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

            cmd.Parameters.Add("@Site", SqlDbType.NVarChar, 25).Value = site;

            SqlParameter countParameter = cmd.Parameters.Add("@Count", SqlDbType.Int);

            countParameter.Direction = ParameterDirection.Output;

            await cmd.Connection.OpenAsync();

            await cmd.ExecuteNonQueryAsync();

            await cmd.Connection.CloseAsync();

            int output = Implicit.Int32(countParameter.Value, 0);

            return(output);
        }