public async Task <IEnumerable <Product> > GetAllTrsAsync(string orderBy) { if (!allowedOrderByQueries.Contains(orderBy)) { throw new InvalidOperationException($"Invalid \" {orderBy} \" orderBy query param. The allowed values are {string.Join(",", allowedOrderByQueries)}"); } var ProductsEntities = await CategoriesTrRepository.GetAllTrs(orderBy); return(mapper.Map <IEnumerable <Product> >(ProductsEntities)); }