Run async method 8 times in parallel

I coded it in the assumption that asynchronous and parallel processing would be the same Asynchronous processing and parallel processing are quite different. If you don’t understand the difference, I think you should first read more about it (for example what is the relation between Asynchronous and parallel programming in c#?). Now, what you want … Read more

Is the CallerMemberName attribute in 4.5 “able to be faked”?

Yes, you can, exactly as you could use LINQ and .NET 2, as you said. I use the following in a .NET 4.0 project with the VS2012 compiler with success: namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] public sealed class CallerMemberNameAttribute : Attribute { } } Be very careful that everyone on … Read more

Why doesn’t generic ICollection implement IReadOnlyCollection in .NET 4.5?

There are probably several reasons. Here are some: Huge backwards compatibility problems How would you write the definition of ICollection<T>? This looks natural: interface ICollection<T> : IReadOnlyCollection<T> { int Count { get; } } But it has a problem, because IReadOnlyCollection<T> also declares a Count property (the compiler will issue a warning here). Apart from … Read more

SignalR Typenamehandling

This can be done by taking advantage of the fact that your types and the SignalR types are in different assemblies. The idea is to create a JsonConverter that applies to all types from your assemblies. When a type from one of your assemblies is first encountered in the object graph (possibly as the root … Read more

.NET 4.5 Beta DbGeography NotImplementedException

DefaultSpatialServices in Entity Framework are using SqlGeography and SqlGeometry types as backing types. These two types live in Microsoft.SqlServer.Types.dll assembly that is not part of the .NET Framework. The exception is thrown when EF cannot find these types (the exception could be more helpful…). When you install Visual Studio it will install localdb on your … Read more