Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / Win32

Cache IQueryable for Better LINQ-to-SQL Performance

Rate me:
Please Sign up or sign in to vote.
4.69/5 (10 votes)
21 May 2012CPOL10 min read 60K   448   33  
An approach to improve LINQ-to-SQL performance while preserving maintainability over DataReader.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;

namespace Prototype.Database.Data
{
    [Table(Name = "job")]
    public class Job
    {
        [Column(Name = "id", IsPrimaryKey = true)]
        public int Id { get; set; }

        [Column(Name = "type")]
        public int Type { get; set; }

        [Column(Name = "person")]
        public int Person { get; set; }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) 3PLearning
Australia Australia
Lead Developer, MMO Game Company
Testor, Microsoft

Comments and Discussions