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. 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. What is in WebMatrix? Getting Started with WebMatrix Let’s create a new Web site. 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. 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. With tools in hand I started creating an integration test suite for the CBC Radio 3 website codebase.

Enough about my objectives, here’s how I plan on making a database testing suite that doesn’t get bogged down by the size of the domain or the number of repositories I have. Castle.WindsorRhino.Commons.BinsorCastle.Facilities.NHibernateIntegrationNHibernate. 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. 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 ValidatableAttribute: Indicates that a class or structure can be validated. Properties (all get/set) string Name: Name of the rule. Examples [Validatable] public class Foo { [Rule(Name = "NameRule")] Func< Foo, bool > RName = f => ! Some lesser-known truths about programming | Dot Mac. My experience as a programmer has taught me a few things about writing software.

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. Bad programmers spend much of that 90% debugging code by randomly making changes and seeing if they work.A good programmer is ten times more productive than an average programmer. A great programmer is 20-100 times more productive than the average.

Codefetch{ Walkthrough: Using MVC View Templates with Data Scaffolding. Aforge - Project Hosting on Google Code.