Browsing 7239 questions and answers with Jon Skeet
Your task, which will be running in another thread, needs to call _one. That method can't execute until your Program type has been initialized. The tasks's thread will see that the Program type is already being initialized in the main... more 12/8/2016 11:46:48 PM
However, am I correct in assuming that once I call .AsEnumerable() the query goes to the database Not quite. When this method returns, it won't have hit the database at all. AsEnumerable() doesn't force the query to execute - it's... more 12/8/2016 12:36:37 PM
They're C#-compiler-generated types, e.g. for anonymous types, iterator blocks, closures that capture local variables, and async functions. This is nothing to do with Entity Framework in itself. If you want to ignore all... more 12/8/2016 11:48:19 AM
The first that you want 32-bit values makes this pretty easy, because you can copy it to an int[], then create one BitArray per int, passing the data by creating a single-element int array: int[] values = new int[bigBitArray.Length /... more 12/8/2016 9:23:38 AM
Not reliably - there's nothing in the FormatException that does this for you. Parsing the message is very fragile - it can change in different versions of .NET, and it'll be localized. One option would be to write your own Parse method... more 12/7/2016 1:33:56 PM
I don't see any problems with inferring that T is of type MyClass even without explicitly saying so Well, the problem is that the language isn't specified that way at all. Generic type inference is performed based on the arguments. A... more 12/6/2016 2:11:05 PM
You can easily write a compose method and use that in multiple places: import java.util.function.*; public class Test { public static void main(String[] args) { Integer zero = 0; Predicate<Integer> isZero =... more 12/6/2016 9:48:39 AM
Logically, what you want is: var query = db.Table.Where(e => list.Any(le => e.EmployeeId == le.EmployeeId && e.EntryDate == le.EntryDate)); I don't know whether that will work... more 12/6/2016 9:32:21 AM
I believe this is partially guaranteed by the CLI spec, although it's not as clear as it might be. From I.12.6.5: Acquiring a lock (System.Threading.Monitor.Enter or entering a synchronized method) shall implicitly perform a volatile... more 12/6/2016 9:05:22 AM
Well something's going to loop somewhere, but it doesn't have to be in your code. Just a LINQ Select will be fine: var result = original.Select(x => (Enum2) x).ToList(); more 12/5/2016 12:53:05 PM