What is difference between push based and pull based structures like IEnumerable and IObservable

Please in a normal and human way explain to me the difference OK, let’s make some toast. That’s the most normal human thing I do. Pull based: // I want some toast. I will pull it out of the toaster when it is done. // I will do nothing until the toast is available. Toast … Read more

Why there is two completely different version of Reverse for List and IEnumerable?

It is worth noting that the list method is a lot older than the extension method. The naming was likely kept the same as Reverse seems more succinct than BackwardsIterator. If you want to bypass the list version and go to the extension method, you need to treat the list like an IEnumerable<T>: var numbers … Read more

Is it possible to turn an IEnumerable into an IOrderedEnumerable without using OrderBy?

All you need to do for the default case is: queryRes = values.OrderBy(a => 1); This will effectively be a noop sort. Because the OrderBy performs a stable sort the original order will be maintained in the event that the selected objects are equal. Note that since this is an IQueryable and not an IEnumerable … Read more

Resharper: Possible Multiple Enumeration of IEnumerable

I don’t know exactly what your properties really is here – but if it’s essentially representing an unmaterialized database query, then your if statement will perform three queries. I suspect it would be better to do: string[] propertiesToFind = { “Property1”, “Property2”, “Property3” }; if (properties.Any(x => propertiesToFind.Contains(x)) { … } That will logically only … Read more

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