I created a method where I'd like to return an IEnumerable, but compiler cannot implicitly convert it to try<Exception, IEnumerable>. My code is just:
public Try<Exception, IEnumerable<Person>> GetAll()
{
using (IDbConnection connection = new SqlConnection(ConnectionString))
{
try
{
return connection.Query<Person>(QueryGetAll);
}
catch(Exception ex)
{
return ex;
}
}
}