I am trying to catch and exception message as below and running into below errors,can anyone provided inputs on how to fix this?is there a better way to handle string matching?
catch (Exception ex)
{
////catch
{
if (ex.Message.Contains("Reading from the stream has failed", StringComparison.OrdinalIgnoreCase))
{
throw;
}
else
{
throw;
}
}
}
Error 1 Instance argument: cannot convert from 'string' to 'System.Linq.IQueryable'
Error 2 'string' does not contain a definition for 'Contains' and the best extension method overload 'System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource, System.Collections.Generic.IEqualityComparer)' has some invalid arguments
Error 3 Argument 3: cannot convert from 'System.StringComparison' to 'System.Collections.Generic.IEqualityComparer' C:\Users\gnakkala\gnakkala_dashboard\source\qcom\qca\wconnect\wbit\automation\Dashboard\sandbox\Dashboard.Data.Repository\BuildRepositories\LookaheadGerritsRepository.cs