c# Programming Glossary: lazily
Most elegant way to generate prime numbers http://stackoverflow.com/questions/1042902/most-elegant-way-to-generate-prime-numbers imagine it being particularly efficient dfa Use LINQ to lazily generate the list of primes Maghis Put lots of primes in a text..
What is the purpose/advantage of using yield return iterators in C#? http://stackoverflow.com/questions/1088442/what-is-the-purpose-advantage-of-using-yield-return-iterators-in-c a collection yourself In general iterators can be used to lazily generate a sequence of objects . For example Enumerable.Range..
Determine the number of lines within a text file http://stackoverflow.com/questions/119559/determine-the-number-of-lines-within-a-text-file or later The File class has a new ReadLines method which lazily enumerates lines rather than greedily reading them all into..
C# Reading a File Line By Line http://stackoverflow.com/questions/1271225/c-sharp-reading-a-file-line-by-line example select record.Key then you have ReadFrom ... as a lazily evaluated sequence without buffering perfect for Where etc...
How to get the index of an element in an IEnumerable? http://stackoverflow.com/questions/1290603/how-to-get-the-index-of-an-element-in-an-ienumerable point of getting things out as IEnumerable is so you can lazily iterate over the contents. As such there isn't really a concept..
FindAll vs Where extension-method http://stackoverflow.com/questions/1531702/findall-vs-where-extension-method elements to a new list whereas Where just returns a lazily evaluated sequence no copying is required. I'd therefore expect..
Does Scala have an equivalent to C# yield? http://stackoverflow.com/questions/1655738/does-scala-have-an-equivalent-to-c-sharp-yield similar to Iterable in Java . As an iterator its evaluated lazily. Update II I could be wrong here but I think the whole point..
Entity Framework lazy loading doesn't work from other thread http://stackoverflow.com/questions/2575990/entity-framework-lazy-loading-doesnt-work-from-other-thread TestSingleThread method works fine the Address property is lazily loaded. But in TestMultiThread I get a NullReferenceException..
How to delay static initialization within a property http://stackoverflow.com/questions/3065952/how-to-delay-static-initialization-within-a-property be set yet while it is on another such syncs can happen lazily . So it is not thread safe. You can try to fix this by making..
Implementation of Lazy<T> for .NET 3.5 http://stackoverflow.com/questions/3207580/implementation-of-lazyt-for-net-3-5 name T Specifies the type of object that is being lazily initialized. typeparam public sealed class Lazy T private readonly.. bool isValueCreated private T value summary Gets the lazily initialized value of the current Lazy T instance. summary public..
Are there any reasons to use private properties in C#? http://stackoverflow.com/questions/3310186/are-there-any-reasons-to-use-private-properties-in-c uses for private properties when private fields need to be lazily loaded when private fields need extra logic or are calculated..
How to expose a collection property? http://stackoverflow.com/questions/35007/how-to-expose-a-collection-property T MyCollection get if this.myPrivateCollectionView_ null lazily initialize view return this.myPrivateCollectionView_ Note that..
How do I atomically swap 2 ints in C#? http://stackoverflow.com/questions/3855671/how-do-i-atomically-swap-2-ints-in-c ref address.Producer address.ProducerNew PART 5 lazily include the new links make a working copy workMask address.Producer.LinkMask_V..
System.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection http://stackoverflow.com/questions/4206634/system-objectdisposedexception-the-objectcontext-instance-has-been-disposed-and share improve this question It sounds like you have some lazily loaded relationship properties that have not yet loaded which..
Random.Next() sometimes returns same number in separate threads http://stackoverflow.com/questions/4613693/random-next-sometimes-returns-same-number-in-separate-threads the details of this and provides an implementation which lazily instantiates one instance of Random per thread using an incrementing..
EF 4.1 - Code First - JSON Circular Reference Serialization Error http://stackoverflow.com/questions/5588143/ef-4-1-code-first-json-circular-reference-serialization-error there the virtual properties to load the object graph lazily possibly causing now the serialization trouble. Edit It's not..
What is the difference between Directory.EnumerateFiles vs Directory.GetFiles? http://stackoverflow.com/questions/5669617/what-is-the-difference-between-directory-enumeratefiles-vs-directory-getfiles EnumerateFiles returns an IEnumerable which can be lazily evaluated somewhat whereas GetFiles returns a string which has..
Why use System.Runtime.Caching or System.Web.Caching Vs static variables? http://stackoverflow.com/questions/5986466/why-use-system-runtime-caching-or-system-web-caching-vs-static-variables probably doesn't qualify as caching. It's really just a lazily loaded globally accessible variable. That's fine as a practical..
What does beforefieldinit flag do? http://stackoverflow.com/questions/610818/what-does-beforefieldinit-flag-do fields are referenced. In theory that means it can be very lazily initialized if you call a static method which doesn't touch..
|