public static IEnumerable <ValidationFailure> Validate <TData>(this SearchRequest searchRequest, bool throwException = true)
        {
            var requestName = searchRequest.GetGenericTypeName();

            var properties = typeof(TData).GetProperties(ReflectionConstants.SearchPropertyFlags);
            var errors     = new List <ValidationFailure>();

            if (searchRequest.Filters != null && searchRequest.Filters.Any())
            {
                for (int i = 0; i < searchRequest.Filters.Count; i++)
                {
                    var filterRequest = searchRequest.Filters[i];
                    var property      = properties.FirstOrDefault(x =>
                                                                  x.Name.Equals(filterRequest.Field, StringComparison.InvariantCultureIgnoreCase));

                    if (property == null)
                    {
                        errors.Add(new ValidationFailure($"Filters.[{i}]", "Field not found"));
                        continue;
                    }

                    filterRequest.Field = property.Name;

                    // TODO; validate property type
                }
            }

            if (searchRequest.Sorts != null && searchRequest.Sorts.Any())
            {
                for (int i = 0; i < searchRequest.Sorts.Count; i++)
                {
                    var sortRequest = searchRequest.Sorts[i];
                    var property    = properties.FirstOrDefault(x =>
                                                                x.Name.Equals(sortRequest.Field, StringComparison.InvariantCultureIgnoreCase));

                    if (property == null)
                    {
                        errors.Add(new ValidationFailure($"Sorts.[{i}]", "Field not found"));
                        continue;
                    }

                    sortRequest.Field = property.Name;

                    // TODO; validate property type
                }
            }

            if (throwException && errors.Any())
            {
                throw new BadRequestException(errors.Select(x => x.ToError()), $"Validation Errors for {requestName}");
            }

            return(errors);
        }