LINQ - Sample Queries

This project contains about 101 samples using LINQ.

 
 
 
 
 
4.8 Star
(89)
175,641 times
Add to favorites
3/13/2012
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

VB.NET
C#
// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
//
//Copyright (C) Microsoft Corporation.  All rights reserved.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.42
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;


public partial class NewCreateDB : DataContext {

    public Table<Person> Persons;


    public NewCreateDB(string connection)
        :
        base(connection) {
    }

    public NewCreateDB(System.Data.IDbConnection connection)
        :
        base(connection) {
    }
}

[Table(Name = "Person")]
public partial class Person : System.ComponentModel.INotifyPropertyChanged {

    private int _PersonID;

    private string _PersonName;

    private System.Nullable<int> _Age;

    public Person() {
    }

    [Column(Storage = "_PersonID", DbType = "INT", IsPrimaryKey = true)]
    public int PersonID {
        get {
            return this._PersonID;
        }
        set {
            if ((this._PersonID != value)) {
                this.OnPropertyChanged("PersonID");
                this._PersonID = value;
                this.OnPropertyChanged("PersonID");
            }
        }
    }

    [Column(Storage = "_PersonName", DbType = "NVarChar(30)")]
    public string PersonName {
        get {
            return this._PersonName;
        }
        set {
            if ((this._PersonName != value)) {
                this.OnPropertyChanged("PersonName");
                this._PersonName = value;
                this.OnPropertyChanged("PersonName");
            }
        }
    }

    [Column(Storage = "_Age", DbType = "INT")]
    public System.Nullable<int> Age {
        get {
            return this._Age;
        }
        set {
            if ((this._Age != value)) {
                this.OnPropertyChanged("Age");
                this._Age = value;
                this.OnPropertyChanged("Age");
            }
        }
    }

    public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string PropertyName) {
        if ((this.PropertyChanged != null)) {
            this.PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
        }
    }
}