X

.NET

Performance: Using LCG to copy property values of two objects

Today I gave last performance boost to my property values copying mechanism. I would like to thank my readers Ron and David to remind me Lightweight Code Generation (LCG) and pointing me out aussie bloke blog entry Generic copy object using Lightweight Code Generation. In this posting I will show you last performance boost and put down a summary about my experiment this far.

Performance: Using dynamic code to copy property values of two objects

Last year I wrote short posting about how to use LINQ to find matching properties of two objects. In this posting I will show you how to copy values from one object to another and how to boost up performance so you can use this strategy also on in servers under heavy load.

.NET Framework 4.0: Comparing LINQ and PLINQ performance

In one of my sessions I demonstrated how PLINQ uses two CPU-s instead of one and has better performance than non-parallel processing. In this posting I will introduce my experiment and show you my example results. In the end of this posting you can find source code that is ready for demonstration.

Using LINQ and reflection to find matching properties of objects

As a side product of some experiments I wrote simple LINQ query that matches properties of two objects and returns these properties as list. The code I wrote is pretty simple and I packed it for you as method.

.Net Framework 4.0: VB.NET supports automatic properties

Next version of .Net Framework brings some new features also to VB.NET. One of those new features is support for automatic properties. C# automatic properties are here from .Net Framework 3.5 and now are them also in VB.NET. In this posting I will show to VB.NET users how to use automatic properties and explain why to use them. (more…)

Writing cache based repositories for web application prototyping

When I started building in-house demo application I thought about how to solve temporary data layer so I don’t have to use real database and object mappings for it. Playing with new object model and new components I move way faster if I don’t have any additional ballast that I can avoid. So I wrote simple cache based repository mechanism I can use to imitate real repositories that I will write in the future.

Enumerating file system objects in C#

In my last posting I introduced new ReadLines() method and new overloads for WriteAllLines() method of File class. But there are more new stuff in System.IO namespace. In .Net Framework 4.0 Directory and DirectoryInfo class are able to enumerate files, directories and file system entries. In this posting I will show you these new features.

.Net Framework 4.0: System.IO.File supports now IEnumerable

.Net Framework 4.0 adds also some new and cool features to file system objects. File class has now ReadLines() methods that returns IEnumerable. WriteAllLines() methods has two overload methods that accept IEnumerable instead of strings array that was also supported in previous versions of .Net Framework. This posting introduces ReadLines() and WriteAllLines() methods and gives you some ideas how to use these methods in your applications.

String.IsNullOrWhiteSpace() method in C#

.Net Framework 4.0 Beta 2 has new IsNullOrWhiteSpace() method for strings generalizes IsNullOrEmpty() method to incluse also other white space besides empty string. In this posting I will show you simple example that illustrates how to use IsNullOrWhiteSpace() method.

Complex numbers with C#

.Net Framework 4.0 Beta 2 introduces new class in System.Numerics namespace: Complex. Complex represents complex numbers and enables different arithmetic operations with complex numbers. In this posting I will show you how to use complex numbers in .Net Framework 4.0 applications.