C#

TwitterFacebook
Get flash to fully experience Pearltrees
Dynamic

In this post I’ll try to answer the most common questions I find on forums and in documentation feedback about C# covariance and contravariance. It’s a big topic for a single blog post, so expect to see a lot of “more information” links. Special thanks to Eric Lippert and Chris Burrows for reviewing and providing helpful comments. What are covariance and contravariance?

Covariance and Contravariance FAQ - C# Frequently Asked Questions

http://blogs.msdn.com/b/csharpfaq/archive/2010/02/16/covariance-and-contravariance-faq.aspx?Redirected=true
WCF

Nhibernate

Network

Message Queuing

Quartz Scheduler | Documentation | Tutorial Lesson 05

SimpleTrigger should meet your scheduling needs if you need to have a job execute exactly once at a specific moment in time, or at a specific moment in time followed by repeats at a specific interval. For example, if you want the trigger to fire at exactly 11:23:54 AM on January 13, 2015, or if you want it to fire at that time, and then fire five more times, every ten seconds. With this description, you may not find it surprising to find that the properties of a SimpleTrigger include: a start-time, and end-time, a repeat count, and a repeat interval. All of these properties are exactly what you'd expect them to be, with only a couple special notes related to the end-time property. The repeat count can be zero, a positive integer, or the constant value SimpleTrigger.REPEAT_INDEFINITELY. http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-05
Synchronization

OData and Authentication – Part 6 – Custom Basic Authentication - WCF Data Services Team Blog

You might remember, from Part 5 , that Basic Authentication is built-in to IIS. So why do we need ‘Custom’ Basic Authentication? Well if you are happy using windows users and passwords you don’t. That’s because the built-in Basic Authentication, uses the Basic Authentication protocol, to authenticate against the windows user database. http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication.aspx

Using Reactive Extensions for Streaming Data from Database - About My Code

You have probably heard about Reactive Extensions , a library from Microsoft that greatly simplifies working with asynchronous data streams and allows to query them with Linq operators. There are many different scenarios where using rx results in a much more simple and flexible code. This post demonstrates how to use reactive extensions for loading data from database asynchronously in chunks. The Problem Recently I had to load data from sqlite database in grid view but the query was taking long time as there were hundreds of thousands of rows and the query was doing like %search term% filtering. http://www.aboutmycode.com/reactive-extensions/using-reactive-extensions-for-streaming-data-from-database/

Trackable DTO’s: Taking N-Tier a Step Further with EF4 - DevelopMentor

http://www.develop.com/efntierdto Download code for this article here . There’s been some discussion lately in the blogosphere on Self-Tracking Entities in EF4 and how well they might fit into a heterogeneous environment, where a Java client might consume a .NET service that exposes Self-Tracking Entities. While STE’s are placed in an assembly that does not reference the Entity Framework, the way in which change state is preserved in an STE is overly complex and seems to be designed to make it easier for EF to transmit changes to the ObjectStateManager on the service side. If you look closely at the ObjectChangeTracker class that is generated for the client, you’ll see that it maintains metadata for navigation properties with items that have been added or removed, as well as original values and extended properties.

Object lifetime management with Unity | Code through the pain

If you have been using inversion of control containers for a while you have most probably used some object lifetime management. The lifetime management enables reuse of existing object instances for subsequent resolution. It should be also responsible for controlling how the container will release resolved instances. http://www.ladislavmrnka.com/2011/03/unity-build-in-lifetime-managers/
http://msdn.microsoft.com/en-us/library/aa717040(v=vs.85).aspx

Custom WSDL Publication

Download sample This sample demonstrates how to: The service in this sample is marked with two custom attributes. The first, the WsdlDocumentationAttribute , accepts a string in the constructor and can be applied to provide a contract interface or operation with a string that describes its usage. The second, WsdlParamOrReturnDocumentationAttribute , can be applied to return values or parameters to describe those values in the operation.

DataContract Serializer and IsReference property « Zulfiqar's weblog

i 7 Votes In .net Framework 3.5 SP1, DataContractSerializer supports by-ref object graph serialization by using the standard xsd:ID/xsd:IDREF attributes. http://zamd.net/2008/05/20/datacontract-serializer-and-isreference-property/
WCF DataContract serializer isn't by default aware of cyclic object graphs. If you encounter the Object graph for type 'X.Y.Z' contains cycles and cannot be serialized if reference tracking is disabled error - read to the end. There is a simple solution and it's well documented in the Preserving Object Reference in WCF article. However the code is very chaotic and contains mistakes. I've made several classes to support a simple and powerful control over the DataContract serialization parameters.

WCF cyclic references support

http://chabster.blogspot.com/2008/02/wcf-cyclic-references-support.html
http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm All the patterns: The patterns for DateTime.ToString ( 'd' ) : The patterns for DateTime.ToString ( 'D' ) : The patterns for DateTime.ToString ( 'f' ) : The patterns for DateTime.ToString ( 'F' ) : The patterns for DateTime.ToString ( 'g' ) :

DateTime.ToString() Patterns

The Truth About Value Types - Fabulous Adventures In Coding

Excelent post, Eric! By the way, I found your blog while searching for this subject (your older post). I think most of this "local variables are allways stored on the stack" conviction comes from unmanaged world. One time, in an interview, one guy asked my about this, knowing that my primary programming language is C#. I really never cared about this until this situation, just because I choosed for a managed language and I can live with the idea that CLR is there to choose a better way to JIT my code.
Scaling NServiceBus Sagas When looking at NServiceBus sagas (process managers), especially at high volume of messages, we often run into two main problems: Deadlocks Starvation This is because of the fundamental (default) design of sagas is that: A single saga shares a single … Continue reading Saga implementation patterns – variations In the previous couple of posts, I looked at the two main patterns I run into when looking at sagas: Command-oriented (request/response) in the Controller pattern Event-oriented (pub/sub) in the Observer pattern Of course, these aren’t the only ways our … Continue reading Saga implementation patterns – Controller

Jimmy Bogard's Blog | Strong opinions, weakly held

Pattern Matching in C# - Part 1

Monday, April 07, 2008 2:00 AM bart In the previous episode of this series we took a look at the concept of pattern matching as it exists in a couple of functional languages out there as well as how we're going to map it to C# 3.0 syntax. We left off with the exercise of guesstimating the public contract of our Pattern`1 class based on this sample:
Tuesday, April 08, 2008 2:00 AM bart In our journey to find the perfect match, we've arrived at an interpreter-based pattern matcher in the previous post . Although there are quite some limitations and the syntax isn't as sweet as we'd like it to be, it's fully functional . However, what about the performance of our pattern matcher?

Pattern Matching in C# - Part 2

MEF - Arrange Act Assert

In this post I want to show how MEF can be used to apply the Open Closed Principle where a class is open for extension but closed for modification. In the Calculator application we have been building as part of the Silverlight refactoring series we could have used the code below to validate a users input. By the way we are throwing exceptions because the application is using ValidatesOnExceptions.