public QueryContracts.Common.QueryResult Handle(ListarClientesParameter parameters) { using (var connection = (SqlConnection)ConnectionFactory.CreateFromUserSession()) { var parametros = new DynamicParameters(); var result = new ListarClientesResult(); result.Hits = connection.Query <ListarClientesDto>( "seguridad.pa_listarclientes", parametros, commandType: CommandType.StoredProcedure).ToList(); return(result); } }
public QueryResult Handle(ListarClientesParameters parameters) { using (var connection = (SqlConnection)ConnectionFactory.CreateFromUserSession()) { var parametros = new DynamicParameters(); parametros.Add("criterio", dbType: DbType.String, direction: ParameterDirection.Input, value: parameters.criterio); parametros.Add("activo", dbType: DbType.String, direction: ParameterDirection.Input, value: parameters.activo); var resultado = new ListarClientesResult { Hits = connection.Query <ListarClientesDto> ( "seguimiento.pa_listarclientes", parametros, commandType: CommandType.StoredProcedure ), }; return(resultado); } }