Browse by Tags

Model Binder
15 December 08 10:45 PM | MattManela | 0 Comments   
When working with a multi-tier application I often find myself converting from one of the tiers object models to my own similar (but often different) model.  I often write code that would set one by one each property from a web tier object to my Read More...
Filed under: ,
SQL CE 3.5 with LINQ to SQL Revisited
26 September 08 08:26 AM | MattManela | 2 Comments   
A few days ago I made a post about using SQL CE 3.5 with LINQ to SQL .   I described a way to use connection pooling with SQL CE. A gracious blog reader (Mike Brown)  pointed out a way I could make my solution much simpler by using the Read More...
Filed under: , ,
SQL CE 3.5 with LINQ to SQL
09 September 08 02:04 PM | MattManela | 2 Comments   
Using LINQ to SQL with SQL CE 3.5 can be a bit of a challenge.  First off, the LINQ to SQL Visual Studio designer doesn't support SQL CE so you need to run sqlmetal from the command line to create the object model (or write it by hand).  Once Read More...
Filed under: , , ,
CollectionView.DeferRefresh() : My new best friend
28 August 08 02:23 PM | MattManela | 2 Comments   
Well, maybe not best friend but its a nice function.  When working with bound collections in WPF you often end up dealing with a CollectionView .  This is the MSDN documentation description of a CollectionView : You can think of a collection Read More...
Filed under: , ,
Foreach is Duck Typed!
22 July 08 10:04 AM | MattManela | 5 Comments   
I thought I know how the foreach construct worked under the covers. I figured the compiler would check if the type being iterated over implement IEnumerable or IEnumerator. And if so it will call MoveNext and Current to loop over the elements. But then Read More...
Filed under: , ,
ArgumentNullException vs ArgumentException
28 May 08 09:17 PM | MattManela | 2 Comments   
Both ArgumentNullException and ArgumentException have a constructor which takes two strings. One is the name of the parameter (or argument) in question and the other is a string describing the exception. The funny/odd/interesting thing about them is that Read More...
Filed under: ,
Intro to LINQ to SQL Optimistic Concurrency
22 May 08 08:40 PM | MattManela | 0 Comments   
After some investigation I feel I have a decent understanding on how LINQ to SQL concurrency works. LINQ to SQL uses optimistic concurrency which means that it never takes an exclusive lock on a table. It caches the information you are working with and Read More...
Filed under: , ,
Closures and Pass by Reference
30 April 08 07:15 PM | MattManela | 5 Comments   
What do you think the following code will do? Compile time error Run time error Work fine 1: static void Main( string [] args) 2: { 3: int x = 10; 4: int y = 5; 5: Swap( ref x, ref y); 6: } 7: 8: 9: static void Swap( ref int x, ref int y) 10: { 11: int Read More...
Filed under: ,
Lazy Prime Number Sieve in C#
16 March 08 11:28 PM | MattManela | 3 Comments   
In my last post I talked about a Stream class for creating efficient lazy lists in C#. In addition, I showed several classic functional methods I ported to C# to be used on the lazy lists. As I mentioned in that post, I will now talk about an example Read More...
Filed under: , ,
Digging deeper into C# Lazy Lists
14 March 08 11:47 PM | MattManela | 2 Comments   
One of the most interesting aspects of the Haskell language is the fact that features lazy evaluation. My interest in lazy evaluation led me to a post on Wes Dyers blog about lazy lists in C#. In his blog post he talks describes how to create a lazy list Read More...
Filed under: , ,
Useful LINQ Method- GetMemberTypeChain
06 March 08 11:18 PM | MattManela | 1 Comments   
Recently, I have been working on a custom LINQ provider in C#. In a later post (when I have more time to write) I will go in depth into what I am worked on and what have I learned about writing a LINQ provider. But for now I will present a simple function Read More...
Filed under: , ,
Understanding Variable Capturing in C#
01 March 08 11:21 AM | MattManela | 2 Comments   
With the addition of anonymous delegates in C# 2.0 and with lambda expressions in C# 3.0 you might have been hearing a lot about variable capturing. This is the mechanism in which the delegate/lambda which was defined inline is able to hold on to any Read More...
Filed under: ,
FastSharp - Write it, Execute it
11 February 08 11:30 PM | MattManela | 5 Comments   
Last year I wrote this program which I named FastSharp. It is a text editor which lets you compile and run C# code that would normally exist inside a method. The inspiration for this came from getting tired of opening up Visual Studio and creating a project Read More...
Who would have thunk it?
18 December 07 10:40 PM | MattManela | 1 Comments   
I recently read this article about Lazy Computation in C# . What the article discusses is creating lazy evaluation in C#. Lazy evaluation is a key feature of functional languages like Haskell but is not common in imperative languages. It is used in Haskell Read More...
Filed under: , ,
Did you know.... Generic Methods
16 December 07 11:14 AM | MattManela | 1 Comments   
Did you know that you can call a generic method with out supplying the type argument. The C# compiler will fill in the type parameter for you at compile time since the language is strongly typed. static void MyMethod<S>(S myParam) { Console.WriteLine( Read More...
Filed under: ,
More Posts Next page »
Page view tracker