AutoMapper uses a fluent configuration API to define an object-object mapping strategy. It uses a convention-based matching algorithm to match up source to destination values. Currently, it is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.
Conventions
Since AutoMapper flattens, it will look for:
- Matching property names
- Nested property names (Product.Name maps to ProductName, by assuming a PascalCase naming convention)
- Methods starting with the word “Get”, so GetTotal() maps to Total
- Any existing type map already configured
Basically, if you removed all the “dots” and “Gets”, AutoMapper will match property names. Right now, AutoMapper does not fail on mismatched types, but for some other reasons.
Features rundown
AutoMapper supports:
- Mapping of simple types
- Mapping to arrays from any IEnumerable source
- Custom member resolution, for that 1% case you have to do some extra mapping work
- Polymorphic array mapping
- Custom formatting for mapping from any type to a string
- Global formatters
- Null substitutes for formatting (i.e. a missing Product formats to “n/a”)
- Profiles, for separating different sets of configurations (JSON vs. ViewModel vs. EditModel etc)
Other features include:
- Convention of no null destination objects, ever.
- No null destination array properties, ever.
- A fluent configuration, with both a method chaining syntax (through Mapper) and object scoping (through a Profile)
For more information, please go to http://automapper.codeplex.com/
The new release of Visual Studio 2010 has plenty of compelling new features and updates that will make every developer more productive. For instance:
- Visual Studio 2010 allows users target of the right platform for their application, including Windows 7, Windows Server 2008 R2, SQL Server 2008, SharePoint. Office, Windows Azure, and Windows Phone 7 applications using their existing skills.
- Visual Studio 2010 is a rich, personalized development environment. We know that software developers spend much of their time in the IDE, and features like the new editor and multi-monitor support make your time in Visual Studio more productive and enjoyable.
Teams are able to work more efficiently using Application Lifecycle Management tools. The Visual Studio 2010 team have done a great deal of work in Visual Studio 2010 to improve testing and debugging tools. Features like IntelliTrace and easy project management help your team ensure high quality.
If you are an MSDN subscriber, later in the day on April 12th you can download Visual Studio 2010 from MSDN.
Scott Guthrie just announced yesterday that ASP.NET MVC 2 final release is available for VS 2008/Visual Web Developer 2008 Express with ASP.NET 3.5.
ASP.NET MVC 2 Features
- New Strongly Typed HTML Helpers
- Enhanced Model Validation support across both server and client
- Auto-Scaffold UI Helpers with Template Customization
- Support for splitting up large applications into “Areas”
- Asynchronous Controllers support that enables long running tasks in parallel
- Support for rendering sub-sections of a page/site using Html.RenderAction
- Lots of new helper functions, utilities, and API enhancements
- Improved Visual Studio tooling support
- Can run side-by-side with MVC 1 (meaning you can have some apps built with V1 and others built with V2 on the same machine)
If you’re planning to use Visual Studio 2010 or Visual Web Developer 2010, they will have ASP.NET MVC 2 built-in.
Please click here to go to MS’s download page.
Microsoft Visual Studio 2010 RC and .Net Framework 4 RC have been released and available for download. Please click on the link provided below to go to the download page.
http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en
I just found an interesting comparison in performance of two common ORM frameworks: Microsoft Entity Framework and NHibernate. Here’s a quick summary of the performance comparison:
| Operation / Number of operations |
NHiberante – 4K |
Entity Framework – 4K |
NHiberante – 40K |
Entity Framework- 40K |
Winner |
| Store |
37.37 |
9.19 |
1500 |
98 |
Entity Framework |
| Read over relations |
1.01 |
0.54 |
10.13 |
4.18 |
Entity Framework |
| Read by ID |
3.06 |
25.22 |
246 |
230 |
NHibernate with smaller amount of objects |
| Update |
6.61 |
7.34 |
77 |
72 |
Both |
| Delete |
3.35 |
16.76 |
58 |
1824 |
NHibernate |
If you’re interested in the details of the performance measurements, please go to GregDoesIt.com.
In Visual Studio 2008, all documents/files/designers are hosted within a single top-level window – which unfortunately means that you can’t partition the IDE across multiple monitors.
VS 2010 addresses this by now allowing editors, designers and tool-windows to be moved outside the top-level window and positioned anywhere you want, and on any monitor on your system. This allows you to significantly improve your use of screen area, and optimize your overall development workflow.
If you work on a system that has multiple monitors connected to it, you will find the new multi-monitor support feature within VS2010 a big productivity boost. But if you don’t already have multiple monitors connected to your computer, this might be a good excuse to get some…
For more information, please see the original post at:
http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4-series.aspx
NArrange is a .NET code beautifier that automatically organizes code members and elements within .NET classes.
Why You Should Use NArrange?
There are several reasons you may want to consider using NArrange for your .NET software project:
- Reduces the amount of time developers spend arranging members within code files. With NArrange, you don’t need to worry about where you place a new member definition in a class… just type away and run NArrange prior to compilation. After formatting, the new member will be automatically moved to the appropriate location in the source file.
- Helps enforce coding style standards
- When used as part of check-in procedures, NArrange can help reduce source code repository conflicts.
- NArrange can automatically group similar code members into predefined region blocks, if supported by the language (C# and VB).
- Reduces the amount of time spent searching for specific members in a code file. Through standard arrangement of source code files, every member of the team will know exactly where in a file to look for private fields, constructors, etc.
- Flexibility – NArrange allows you to configure how members are organized (grouping, sorting, regions, etc.)
- Sort Usings
For more information about this free product (open source), please go here.