background preloader

C#

Facebook Twitter

Webdev

Development. Orm. Ef4. Introducing WebMatrix. Last week I published several blog posts that covered some new web development technologies we are releasing: IIS Developer Express: A lightweight web-server that is simple to setup, free, works with all versions of Windows, and is compatible with the full IIS 7.5. SQL Server Compact Edition: A lightweight file-based database that is simple to setup, free, can be embedded within your ASP.NET applications, supports low-cost hosting environments, and enables databases to be optionally migrated to SQL Server. ASP.NET “Razor”: A new view-engine option for ASP.NET that enables a code-focused templating syntax optimized around HTML generation.

You can use “Razor” to easily embed VB or C# within HTML. It’s syntax is easy to write, simple to learn, and works with any text editor. Today we are also announcing a new lightweight web development tool that also integrates the above technologies, and makes it even easier for people to get started with web development using ASP.NET. Unit Testing Domain Persistence With NDbUnit, NHibernate and SQLite : Scott Muc. Ever since I’ve begun using NHibernate the number one thing that’s caused me a lot of headaches is learning how to properly map my domain objects.

Unit Testing Domain Persistence With NDbUnit, NHibernate and SQLite : Scott Muc

Even the most basic mappings I wrote had bugs simple because I overlooked trivial items. This made me realize that I could save a lot of time and hassle if I unit tested by data access layer. I’m a neophyte when it comes to unit testing, but over the last six months I’ve started to understand the benefits of testing and where it fits in with my development cycle. In order to test my mappings I needed a simple way of placing dummy data into my database. I also wanted to use SQLite as my test database implementation for simplicity, and speed reasons. Validation Library using C# 3.0 Lambda Expressions. Free source code and programming help. Download source project - 12.68 KB Introduction In Enterprise Library - Validation Application Block we have attributes to define complex validation expressions.

Validation Library using C# 3.0 Lambda Expressions. Free source code and programming help

But it is too complicated and slow, because it will use a lot of casting and boxing code under the hood. In C# 3.0, we have strongly typed lambda expressions so why not use them for validation logic? Background Imagine this business class: public class Foo { public string Name { get; set; } public int Index { get; set; } } Let's say that the Name property can't be null or empty and the Index should be in 0 and 100 range. [Validatable] public class Foo { Func< Foo, bool > NameRule = f => ! And we only need a solution to do the validation checks, this is why I am here for today. The Validation Library Attributes. Some lesser-known truths about programming. My experience as a programmer has taught me a few things about writing software.

Some lesser-known truths about programming

Here are some things that people might find surprising about writing code: Averaging over the lifetime of the project, a programmer spends about 10-20% of his time writing code, and most programmers write about 10-12 lines of code per day that goes into the final product, regardless of their skill level. Good programmers spend much of the other 90% thinking, researching, and experimenting to find the best design. Codefetch{ Walkthrough: Using MVC View Templates with Data Scaffolding. Aforge - Project Hosting on Google Code.