Getting all messages from InnerException(s)?

Unfortunately LINQ doesn’t offer methods that could process hierarchical structures, only collections. I actually have some extension methods that could help do this. I don’t have the exact code in hand but they’re something like this: // all error checking left out for brevity // a.k.a., linked list style enumerator public static IEnumerable<TSource> FromHierarchy<TSource>( this … Read more

Only Add Unique Item To List

If your requirements are to have no duplicates, you should be using a HashSet. HashSet.Add will return false when the item already exists (if that even matters to you). You can use the constructor that @pstrjds links to below (or here) to define the equality operator or you’ll need to implement the equality methods in … Read more

Convert from List into IEnumerable format

You don’t need to convert it. List<T> implements the IEnumerable<T> interface so it is already an enumerable. This means that it is perfectly fine to have the following: public IEnumerable<Book> GetBooks() { List<Book> books = FetchEmFromSomewhere(); return books; } as well as: public void ProcessBooks(IEnumerable<Book> books) { // do something with those books } which … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)