Archives

Archives / 2008 / April
  • Montreal Team System User Group Inaugural Meeting

    Tomorrow, we are launching a new user group dedicated to the application life cycle with Team System and Team Foundation Server in Montreal.

    Etienne Tremblay and Claude Remillard, both Team System MVPs, will run the group.  They will also present on the inaugural meeting.

    More info at www.guvsm.net

    Survol de Visual Studio Team System et Roadmap

    29 avril 2008 à 18:15

     

    VSTS
    Conférenciers: Claude Remillard, MVP Team System et Étienne Tremblay, MVP Team System

    Étienne Tremblay est un architecte sénior chez EDS Canada avec plus de 15 ans d'expérience en développement d'applications d'entreprises. Il a travaillé dans les industries minières et manufacturières et récemment, la gestion de configuration et outillage de développement. Il a développé un système pour surveiller la qualité dans la fabrication de voitures, un système de gestion de réclamations, un système d’opération et de surveillance de mines et un système de gestion de  d'itinéraires en utilisant des modèles d'application n tiers. Tout au long de ces années il est devenu un expert en matière d'outillage de cycle de vie de développement de logiciels et a été l'un des architectes de la solution corporative Visual Studio Team System chez EDS. Cette initiative l’a amené à voyager autour du monde pour donner de la formation adaptée aux développeurs .NET d'EDS. Il a été un conférencier lors de plusieurs conférences internationales en 2005, 2006 et 2007 sur Visual Studio. Il a aussi donné une conférence virtuelle pour MSDN sur « comment adopté Visual Studio Team System ». Il représente EDS sur le Conseil Consultatif de Microsoft pour Team System. Il a été attribué le statut de MVP Team System en 2006 et 2007 et a été choisi comme juge pour la compétition internationale de Design de Logiciel de l’Imagine Cup 2007 en Corée du Sud.

    M. Rémillard est co-fondateur et président de la firme InCycle et a obtenu le statut de MVP Team System en 2007. Au cours de ces dernières années, M. Rémillard présente régulièrement a diverses tribunes au sujet des meilleures pratiques en gestion du cycle de vie des applications, tout autant pour le compte d’InCycle que celui de Microsoft. Précédemment, il a occupé divers postes de direction dans le secteur du développement logiciel. Il a notamment été président d’Acceleron, une société de développement de logiciels qui a mis au point et commercialisé une solution de gestion des dépenses pour laquelle près d’un demi-million de licences ont été vendues dans le monde.

    Read more...

  • SQL Injection Attacks on IIS Web Servers

    There have been conflicting reports about SQL Server injection attacks and a possible new IIS vulnerability.

    • This is not related to a new IIS or SQL or ASP.NET vulnerability
    • A bot is scanning the Web trying SQL Server injections
    • Of course, it is finding a lot of poorly designed non secured pages

    Get the facts and learn about injection attacks:
    http://blogs.iis.net/bills/archive/2008/04/25/sql-injection-attacks-on-iis-web-servers.aspx

     

    Read more...

  • DevTeach Toronto is coming - Register!

    If you're living in Toronto and don't attend DevTeach, I'm gonna beat you up and force you to code in Clipper for the rest of your life.  Seriously, DevTeach has one of the greatest speakers lineup of all the .NET conferences.

    Honestly, where can you hear, see, talk to, describe your problems (IT/Dev related or not) and have a beer with these guys/gals?

    And that's only half of them!!!

    Need more reasons?

    Keynote by Scott Hanselman, Microsoft
    Scott Hanselman is one of the most prolific, renowned and respected blogger (http://www.hanselman.com) and podcaster (http://www.hanselminutes.com) about technologies. Scott is a hands-on thinker, a renowned speaker and writer. He has written a few books, most recently with Bill Evjen and Devin Rader on Professional ASP.NET. In July 2007, he joined Microsoft as a Senior Program Manager in the Developer Division. In his new role he'll continue to explore and explain a broad portfolio of technologies, both inside and outside Microsoft. He aims to spread the good word about developing software, most often on the Microsoft stack. Before this he was the Chief Architect at Corillian Corporation, now a part of Checkfree, for 6+ years and before that he was a Principal Consultant at STEP Technology for nearly 7 years.
    http://www.devteach.com/keynote.aspx

    Silverlight 2.0 workshop
    For the first time an independent conference is having a workshop on Building Business Applications with Silverlight 2.0.  Join Rod Paddock and Jim Duffy as they give you a head start down the road to developing business-oriented Rich Internet Applications (RIA) with Microsoft Silverlight 2.0. In case you just crawled out from under a rock, Microsoft Silverlight 2.0 is a cross-browser, cross-platform, and cross-device plug-in positioned to revolutionize the way next generation Rich Internet Applications are developed. Microsoft’s commitment to providing an extensive platform for developers and designers to collaborate on creating the next generation of RIAs is very clear and its name is Silverlight 2.0. In this intensive, full-day workshop, Rod and Jim will share their insight and experience building business applications with Silverlight 2.0 including a review of some of the Internet’s more visible Silverlight web applications. This workshop is happening on Friday May 16 at the Hilton Toronto.
    http://www.devteach.com/PostConference.aspx#PreSP

    Bonus session: .NET Rock host a panel May 14th at 18:00
    This year the bonus session (Wednesday May 14 at 18:00) will be a panel of speakers debating the Future of .NET. Where is .NET going? How will new development influence .NET and be influenced by .NET? Join Carl Franklin and Richard Campbell from .NET Rocks as they moderate a discussion on the future directions of .NET. The panellists include individuals who have strong visions of the future of software development and the role that .NET can play in that future. Attend this session and bring your questions to get some insight into the potential future of .NET! This bonus session is free for everyone. Panelists are: Ted Neward,Oren Eini ,Scott Bellware
    http://www.devteach.com/BonusSession.aspx

    Party with Palermo, DevTeach Toronto Edition
    Jeffrey Palermo (MVP) is hosting Monday May 12th in Toronto is acclaimed "Party with Palermo". This is the official social event  kicking off DevTeach Toronto. The event is not just for the attendees of Toronto it’s  a free event for everyone. It’s a unique chance for the attendees, speakers and locals  to meet and talk with a free beer.   The event will be held at the Menage club  location and you need to RSVP to attend. Get all the details at this link:
    http://www.partywithpalermo.com/

    Make sure that DevTeach comes back to Toronto.  Register right now for this year's conference.

    Read more...

  • Pictures from the MVP Summit 2008

    Pictures from the MVP Summit 2008 (some from Laurent Duveau).

    Link to the full album:

    MVP Summit 2008

    Most notables (click for larger pictures)...

    Sea of red

    The Montreal MVPs

    And their jerseys

    Going to the Summit in style

    ScottGu

    SteveB wearing the Canadian jersey during his keynote thanks to Barry Gervin

    The French MVPs had to wear what?  Looks like they weren't happy about it  ;-)

    However, we had so much fun with them

    Read more...

  • Montreal VS UG: Launch of the Team System SIG

    logoGUVSM.gif

    more info at www.guvsm.net

    Prochaine assemblée

    Mardi 29 avril 2008

    Meeting inaugural du groupe d’intérêt Team System

    VSTS

    Survol de Visual Studio Team System et Roadmap
    Conférenciers: Claude Remillard, MVP Team System et Étienne Tremblay, MVP Team System


    Étienne Tremblay est un architecte sénior chez EDS Canada avec plus de 15 ans d'expérience en développement d'applications d'entreprises. Il a travaillé dans les industries minières et manufacturières et récemment, la gestion de configuration et outillage de développement. Il a développé un système pour surveiller la qualité dans la fabrication de voitures, un système de gestion de réclamations, un système d’opération et de surveillance de mines et un système de gestion de d'itinéraires en utilisant des modèles d'application n tiers. Tout au long de ces années il est devenu un expert en matière d'outillage de cycle de vie de développement de logiciels et a été l'un des architectes de la solution corporative Visual Studio Team System chez EDS. Cette initiative l’a amené à voyager autour du monde pour donner de la formation adaptée aux développeurs .NET d'EDS. Il a été un conférencier lors de plusieurs conférences internationales en 2005, 2006 et 2007 sur Visual Studio. Il a aussi donné une conférence virtuelle pour MSDN sur « comment adopté Visual Studio Team System ». Il représente EDS sur le Conseil Consultatif de Microsoft pour Team System. Il a été attribué le statut de MVP Team System en 2006 et 2007 et a été choisi comme juge pour la compétition internationale de Design de Logiciel de l’Imagine Cup 2007 en Corée du Sud.

    M. Rémillard est co-fondateur et président de la firme InCycle et a obtenu le statut de MVP Team System en 2007. Au cours de ces dernières années, M. Rémillard présente régulièrement a diverses tribunes au sujet des meilleures pratiques en gestion du cycle de vie des applications, tout autant pour le compte d’InCycle que celui de Microsoft. Précédemment, il a occupé divers postes de direction dans le secteur du développement logiciel. Il a notamment été président d’Acceleron, une société de développement de logiciels qui a mis au point et commercialisé une solution de gestion des dépenses pour laquelle près d’un demi-million de licences ont été vendues dans le monde.

    Read more...

  • Book Review: Learning WCF

    Learning WCF

    Author: Michele Leroux Bustamante
    Publisher: O'Reilly Media, Inc.
    ISBN-10: 0596101627
    ISBN-13: 978-0596101626
    Retail Price: $44.99 US, $58.99 CDN
    Publication Date: May 2007
    Softcover: 582 pages
    Online information: Table of contents, source code
    URL: http://www.oreilly.com/catalog/9780596101626/
    Book URL: http://www.thatindigogirl.com/

    Windows Communication Foundation (WCF) is a set of .NET technologies for building and running connected systems. It unifies various technologies previously available like Web Services and .NET Remoting into a single programming model and let you build Service Oriented Architecture (SOA) applications.

    “Learning WCF” is a book targeted at experienced .NET developers wanting to learn WCF from scratch. In the first chapters, the author explains what services are and the whole idea behind SOA. She then guides you thru the WCF path learning about contracts, bindings, hosting, concurrency, reliability and security. You’ll find plenty of code examples and each one is explained in details. To help you apply the WCF concepts, each chapter has a lab that you can just read or experiment with by downloading the source code. The approach in these labs is a “step by step” one and often, the author guides you thru one path then backtracks and explains you a different way to accomplish the same thing. This is very useful to get a good understanding of the technology.

    Even thought the title has the word “learning” in it, the book will get plenty of mileage serving as a reference book in the future and don’t think that it’s a “light” book; most of the concepts explained are advanced ones. I often had to reread complete sections not because they were poorly written but because of the vast amount of information provided.

    WCF is vast and learning it is not a simple task but thanks to Michele Leroux Bustamante’s “Learning WCF”, this process is a lot simpler. High praises for “Learning WCF”.

    Read more...

  • How to deploy the Crystal Reports 2008 Basic Runtime

    If you created reports using Visual Studio 2008 and Crystal Reports 2008 Basic (the one included with VS) and you want to deploy your app on a server, you'll also need to deploy the CR runtime.  Your first reaction might be to go to the Business Objects Website and download the CR 2008 runtime.

    http://support.businessobjects.com/downloads/runtime.asp#08

    Well, that's the wrong runtime.  That one is for the "full" version of CR 2008 (version 12).  The CR included with VS 2008 is the basic one (version 10.5).

    So where do I get the basic (10.5) runtime?  It's right on your machine:
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5

     

    Read more...

  • Live Mesh Beta now available

    Ray Ozzie hinted it at his Mix08 keynote

    The name: Live Mesh
    https://www.mesh.com/Welcome/Welcome.aspx

    What it is:
    http://dev.live.com/blogs/devlive/archive/2008/04/22/279.aspx

    Ray Ozzie introducing it on Channel 9:
    http://channel9.msdn.com/ShowPost.aspx?PostID=399578

    The architecture:
    http://channel9.msdn.com/ShowPost.aspx?PostID=399577

    Hands on demo on Channel 10:
    http://www.on10.net/blogs/nic/Hands-on-with-Live-Mesh/

    Must now read, watch, try and formulate an opinion  ;-)

    Read more...

  • How to get Enterprise Library 3.1 working in VS 2008

    While waiting for Enterprise Library 4, you might want to use Entlib 3.1 with Visual Studio 2008.  All the blocks will work but the VS integration will not.  Does that mean you're stuck editing the config file by hand?  Not at all, all you need is add a few registry entries by downloading a .REG file from CodePlex.

    http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=entlibcontrib&ReleaseId=11669

    The steps are:

    1. Install EntLib 3.1
    2. Run the .REG file
    3. From the VS command prompt, run devenv /setup

    Voilà!

    Read more...

  • MVP Summit 2008 - Here come the Montreal MVPs

    I finally made it to Seattle.  Why do I say finally?  Well, we were flying American Airlines, you know, the airline that grounded all its MD-80 last week and guess what?  6 MVPs from Montreal were flying on MD-80s Sunday morning flights!  So it's not until Saturday that we had a confirmation from AA that our flights were not cancelled.

    Upon arrival, we were looking for a way to get to our downtown hotels when I noticed a couple of stretched limos.  I asked our much the ride was and it would have been the same price as riding a shuttle so guess what?  The Montreal MVPs arrived to their hotels in grand style:


    Laurent Duveau, Dominic Sevigny and Etienne Tremblay


    Me, Eric Moreau and Mario Cardinal

    Read more...

  • WCF Custom FaultException

    I was trying to return a WCF custom FaultException and just couldn’t figure out how to read the custom info I was sending from the client when I found this blog entry from Jean-Paul Smit:
    http://bloggingabout.net/blogs/jpsmit/archive/2007/03/21/wcf-fault-contracts.aspx

    My comprehension of the whole process was OK, I was just missing one key element and the light came thru when I read this line:

    • in ex.Detail you can find your custom fault contract

    Funny how a single line of text in a short blog entry can help you a lot sometimes  :-)

    Read more...

  • Experts (Part Deux)

    Some of the experts at the Launch 2008 Montreal Technical Readiness 2008: Bertrand, Laurent Duveau, Etienne Tremblay and Mario Cardinal.

    Very very crowded!

    BTW, I forgot to credit Jean-Luc David for the picture in my previous post.  Thanks JL!  Check his pictures here: http://www.flickr.com/photos/jldavid

     

    Read more...

  • SQL Timestamp vs WCF

    In my previous post (LINQ to SQL in multi layered + service apps), I mentioned how LINQ to SQL can be used in WCF apps but how to you deal with concurrency checking?  One way is to use a Timestamp column in your tables.  This is a binary type so how will WCF deal with that?

    LINQ to SQL maps the SQL Timestamp type to the System.Data.Linq.Binary type.  If you add a DataMember attribute to a System.Data.Linq.Binary field, it will work.  WCF will not choke on that.  So what does the client sees?  Something like this: Service1.Binary.

    This whole thing may leads to a few problems:

    1. Binary stuff is not very interoperable
    2. Service1.Binary != System.Data.Linq.Binary

    One solution is to convert the info from Binary to String.  Andrew Siemer posted a couple of extension methods that allow you to do just that.  Check it out:
    http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx

    Simple and easy and you can convert the data right into your LINQ to SQL queries.

     

    Read more...

  • LINQ to SQL: Returning Complex Objects (Performance Problems?)

    In my previous post, one reader commented that the proposed LINQ query would be utterly slow so I did a quick unscientific showdown.

    In the left corner: the query returning complex objects from anonymous types:
    var q = from o in ctx.Orders
            where o.CustomerID == id
            select new { Detail = o.Order_Details, CustomerID = o.CustomerID, OrderDate = o.OrderDate, OrderID = o.OrderID, ShippedDate = o.ShippedDate, ShipCity = o.ShipCity };

    In the right corner: the query returning complex objects from POCOs:
    var q = from o in ctx.Orders
    where o.CustomerID == id
    select new TransportObjects.Northwind.Order {
    Detail = o.Order_Details.Select(item => new  TransportObjects.Northwind.OrderDetail {
    ProductID = item.ProductID 
    }).ToArray(),
    CustomerID = o.CustomerID, OrderDate = o.OrderDate, OrderID = o.OrderID, ShippedDate = o.ShippedDate, ShipCity = o.ShipCity};

    The weapons: 50,000 orders each having 10 order details rows meaning 500,000 objects.

    The result: it's a tie!

    Yep, both queries returned the results in about 2 seconds using SQL Server Express 2005 locally (no layers, no WCF etc)

     

    Read more...

  • LINQ to SQL: Returning Complex Objects

    In my previous post about using LINQ to SQL in multi layered apps, I mentioned that this query was not optimal because I would need to build the POCOs from the objects returned by LINQ.  This would mean that objects would be created twice. 

    var q = from o in ctx.Orders
            where o.CustomerID == id
            select new { Detail = o.Order_Details, CustomerID = o.CustomerID, OrderDate = o.OrderDate, OrderID = o.OrderID, ShippedDate = o.ShippedDate, ShipCity = o.ShipCity };

    Not ideal so I asked if anyone had an idea on how to do that.  Stefan Sedich suggested this query:

    var q = from o in ctx.Orders
    where o.CustomerID == id
    select new TransportObjects.Northwind.Order {

    Detail = o.Order_Details.Select(item => new  TransportObjects.Northwind.OrderDetail {
    ProductID = item.ProductID 
    }).ToArray(),

    CustomerID = o.CustomerID,
    OrderDate = o.OrderDate,
    OrderID = o.OrderID,
    ShippedDate = o.ShippedDate,
    ShipCity = o.ShipCity};

    Cool!  The query returns the Order complex object with the Detail property filled from orders Details.

    Thanks a lot Stefan!

     

    Read more...

  • Team Suite Vnext will be FREE (but ad supported)

    Team Suite Vnext will be FREE (but ad supported)

    At Mix08 in Las Vegas, I had the chance (!) to be invited to a special meeting.  The invite was for only 12 people and it was to demonstrate a revolutionary new Visual Studio feature.  We gathered with Scott Guthrie in a private room at the Aquaknox restaurant at the Venetian hotel where we were treated with exquisite seafood that would have a bad taste later on.

    So what is that revolutionary new Visual Studio feature?  Well, Microsoft plans to offer the next Visual Studio Version for free.  Yeah, Visual Studio Express is already free you might say but I’m talking about the Team Suite here!  Yep, Microsoft plans to offer the $10K product for free!!!  So watch the catch?  Isn’t that some good news?  Well, Microsoft has some large teams dedicated to the development tools and they need to generate revenues to pay for those salaries so the Visual Studio VNext will be free but add supported.  You might say that’s it’s a good deal because you get a $10K product for free by watching a few non obstructive ads well here the catch: the ads are obstructive.  How obstructive?  Check this out.
    First of all, the advert system code name is called Barracuda.  It is already included in the August CTP of Visual Studio Team Suite code name Rosario.  You may have downloaded that version and found nothing special; this is because it is not activated by default.  To activate it, Microsoft has created something clever: you need to input a special set of buttons from an Xbox 360 game controller!

    So you need to connect an Xbox 360 controller to an USB port (the wireless one will also work) on the machine running Rosario and you need to input the button sequence in this precise order:
    At the same time: press the Left trigger + Right trigger + Left thumbstick UP + Right thumbstick DOWN
    While the above are pressed, press the D-pad in this order: Up, Left, Up, Down, Up, Right
    If you entered the correct sequence, the controller will vibrate and this dialog will pop-up inviting you to restart Visual Studio.

    After restarting Visual Studio, create a class library project and take a look at the code.  Yep that’s an ad placed directly on top of your code and no way to turn it off!

    Now shut down Visual Studio, unplug your network cable so you don’t have any Internet access and restart Visual Studio.  You’ll be prompted by this dialog:

    Yes, an Internet connection will be required to use that free ad supported Visual Studio.  If you dismiss this dialog, Visual Studio just closes.  That’s it!  Impossible to use it on the train or at a client without being connected to their network.  How convenient!

    Now the shocking part (yes there are more shocking news!): when the application is compiled and deployed, the add system doesn’t go away because it’s built in the .NET Framework 4.0. When your users will start your app, they will be presented with an ad!

    Microsoft has not completed the Web start-up ad yet but the plan is to whenever a new session starts, the start-up ad will be presented in a DHTML window over your actual application in the browser.  Shocking?  Wait, there’s more!
    The ad system is connected with ADO.NET so ads are inserted right into the data you’re displaying.  The plan is to have one ad being displayed at all time in grids. 

    Oh BTW, your users will also have to be connected to the Internet or your app will simply not run!

    I don’t know about you but that whole ad supported Visual Studio thing smells fishy.  I don’t like it at all and I’d rather pay for Visual Studio then get it for free and annoy my users.  Before posting this info, I contacted Scott Guthrie for voicing my concerns.  This is what he had to say:  April Fools!!!!

     

    Read more...

  • LINQ to SQL in multi layered + service apps

    In a previous post, I was explaining how surprised I was when I discovered that you lose LINQ to SQL change tracking features when working in a multi layered application or when you expose your business logic thru a service layer.  Thanks to everyone (especially Barry Gervin, Rocky Lhotka, Julie Lerman and Rick Strahl) who pointed me to articles, blog posts and code samples, I was able to make sense of all of this.

    Let’s take a look back at my rant and see how I can address each of these points.  BTW, this is by no means the only way to achieve the goal of using LINQ to SQL in a multi layered application.  It’s just simple and easy.  Feel free to comment and share your findings and thoughts.

    1-The presentation layer must reference the DAL directly because this is where the data mapping classes are located.  Yuck!
    Referencing the DAL objects from the presentation layer is bad because you’re creating a strong bond between these layers that are supposed to be decoupled.  The rule states that the presentation layer must not be aware of the data access layer.  What you really need to do is create a transport object layer that will be referenced by the BAL and the DAL.  These objects are just plain POCOs (Plain Old CLR Objects) that will cross all the layers.
       
        public class Customer
        {
            public string CustomerID { get; set; }

            public string CompanyName { get; set; }

            public string ContactName { get; set; }

            public string City { get; set; }

        }


    In your LINQ query, just map the data directly back to your POCO.  In this example, the data is mapped back to the Customer POCO.

    public static List<TransportObjects.Northwind.Customer> SelectAllCustomers()
    {
    using (LINQ.NorthwindDataClassesDataContext ctx = new LINQ.NorthwindDataClassesDataContext())
          {
           var q = from c in ctx.Customers
                select new TransportObjects.Northwind.Customer {CustomerID = c.CustomerID, ContactName = c.ContactName, City = c.City, CompanyName = c.CompanyName };

           return q.ToList< TransportObjects.Northwind.Customer>();
           }
     }

    2-By returning POCOs to the presentation layer instead you lose all the change tracking stuff provided by LINQ to SQL.  Yuck!
    One of the LINQ to SQL benefits is change tracking.  Beside the actual data that is mapped to the objects, LINQ to SQL keeps a copy of that data so when you call the SubmitChanges method of the DataContext object, LINQ to SQL can figure out the objects that changed and can apply these changes (CRUD) back to the database.  And yes, by having a transport objet, you are losing the change tracking benefit but it’s not the end of the world.

    3-Exposing the BAL layer as a set of WCF services you lose the change tracking stuff.  Yuck!
    Change tracking IS state and state is bad in service oriented apps because by definition, they are supposed to be stateless.  OK so how I’m supposed to return my POCOs back to the presentation layer using a WCF service layer?  Simple, use the [DataContract] and [DataMember] attributes in your POCOs.  Now they can cross the WCF service layer.

        [DataContract]
        public class Customer
        {
            [DataMember]
            public string CustomerID { get; set; }

            [DataMember]
            public string CompanyName { get; set; }

            [DataMember]
            public string ContactName { get; set; }

            [DataMember]
            public string City { get; set; }

        }

    4-And what if I want to data bind my grid?  Using the designer, I need to point to the DataClasses sitting in the DAL.  Yuck!
    No need to reference the LINQ classes to generate the correct bindings.  After adding a service reference in your presentation layer, connect the BindingSource object to the WCF proxy classes then when you receive an array of POCOs from the WCF service layer, you only need to bind it to your grid.

    5-OK, I'll lose the change tracking stuff.  Now I'll have to reload each record before saving it?  Yuck!
    Yep, that’s one way to do it but you can apply business rules while doing that.  You can of course do all of this in store procs.

     

    That’s it!  Not bad at all, right?  Sure you lose the change tracking feature but you get the benefit of using LINQ to SQL in your DAL.

    Drawbacks?
    One drawback is when you have complex POCOs like the Order and OrderDetail ones with the Order object having a property of type OrderDetail.  I haven’t found a way to return the Order object correctly stuffed with the OrderDetail data directly from the LINQ query.  What I do is return an anonymous type then loop to build my POCOs, the drawback being that two object creation phases are needed: one for the anonymous types and one for the POCOs.  I wouldn’t return thousands of records this way!  I would simply use a store proc or plain old ADO.NET to retrieve the data, and then build the POCOs.  If somebody has a clever way to do this, please post a comment!

        [DataContract]
        public class Order
        {
            [DataMember]
            public int OrderID { get; set; }

            [DataMember]
            public string CustomerID { get; set; }

            [DataMember]
            public DateTime? OrderDate { get; set; }

            [DataMember]
            public DateTime? ShippedDate { get; set; }

            [DataMember]
            public string ShipCity { get; set; }

            [DataMember]
            public OrderDetail[] Detail { get; set; }

        }

        [DataContract]
        public class OrderDetail
        {
            [DataMember]
            public int OrderID { get; set; }

            [DataMember]
            public int ProductID { get; set; }

            [DataMember]
            public decimal UnitPrice { get; set; }

            [DataMember]
            public int Quantity { get; set; }

        }

            public static TransportObjects.Northwind.Order[] SelectCustomerOrders(string id)
            {
                using (LINQ.NorthwindDataClassesDataContext ctx = new LINQ.NorthwindDataClassesDataContext())
                {

                    List< TransportObjects.Northwind.Order> ordersList = new List<TransportObjects.Northwind.Order>();

                    var q = from o in ctx.Orders
                            where o.CustomerID == id
                            select new { Detail = o.Order_Details, CustomerID = o.CustomerID, OrderDate = o.OrderDate, OrderID = o.OrderID, ShippedDate = o.ShippedDate, ShipCity = o.ShipCity };

                    foreach (var order in q)
                    {
                        TransportObjects.Northwind.Order tempOrder = new TransportObjects.Northwind.Order();
                        tempOrder.CustomerID = order.CustomerID;
                        tempOrder.OrderDate = order.OrderDate;

                        List<TransportObjects.Northwind.OrderDetail> ordersDetailList = new List< TransportObjects.Northwind.OrderDetail>();

                        foreach (var orderDetail in order.Detail)
                        {
                           
                            TransportObjects.Northwind.OrderDetail tempOrderDetail = new TransportObjects.Northwind.OrderDetail();
                            tempOrderDetail.ProductID = orderDetail.ProductID;
                            ordersDetailList.Add(tempOrderDetail);
                        }

                        tempOrder.Detail = ordersDetailList.ToArray<TransportObjects.Northwind.OrderDetail>();
                        ordersList.Add(tempOrder);
                    }

                   return ordersList.ToArray<TransportObjects.Northwind.Order>();

                }
            }

    Hope this helps!

    Read more...