In the first part of this series we didn’t really look at the MVC framework. We talked about what it is and what it does but didn’t look at any code. We did however plan out what we wanted our application to do and created our database schema that will support our application. In this part we are going to jump in and get an MVC Application created and look at the Model portion of the application. We’ll create our domain objects and data repositories. It is important to note that I will be using the Repository Pattern with Pipes and Filters Pattern. So we’ll have our data repositories and their relevant filters. We will then create data service objects that encapsulate the repositories. Also, I will be using LINQ To SQL to interact with the database. If you prefer a different method of data access feel free to use something else. Finally, before we get started, I will not be writing unit tests for this series, at least not showing them in the posts, in order to keep things simple and to keep the posts from getting too long.


Continue Reading...

This is a guest post written by John Daniel-Trask from Mindscape.

Mindscape have released a major upgrade to their LightSpeed domain modelling / ORM tool. Version 2.0 includes a visual model designer integrated into Visual Studio, LINQ support, and the ability to access multiple databases concurrently. LightSpeed is a small, fast domain modeling tool which uses convention over configuration to perform object-relational mapping without the need for complex mapping files.

In the past it’s been necessary to code LightSpeed models explicitly in C# or Visual Basic, but the new Visual Studio-hosted designer enables a more data-centric approach: developers can drag tables from Server Explorer and LightSpeed automatically creates the models for them. Developers can also add validations and tune performance parameters such as caching and lazy/eager loading through the designer. The designer also supports a “round-tripping” approach whereby changes to the database can be applied incrementally to the…


Continue Reading...

Linq to xml provides an easy query interface for XML files. In the following example I will demonstrate how to use linq to xml to read and write data from/to xml file, using the file for persistency maintaining a list of objects. linq to xml can be used for storing application settings, storing persistent objects […]


Continue Reading...

LINQ to SQL maps the relational database into an object model, and when the program runs the queries in the object model are translated into SQL. SQL contains Aggregate functions like SUM, AVG, MIN, MAX and more. Lets see how this functionality can be implemented using LINQ Enumerable standard aggregation operators. You can also create […]


Continue Reading...

This one is for all you guys who are just starting to use LINQ and have no idea how to make those queries work. I have tried it and i am glad to say that it is very friendly and usable especially if you have no experience with Linq Linqpad is a very user friendly […]


Continue Reading...