Загрузка данных


// КЛАССЫ ДЛЯ LINQ to SQL

[Table(Name = "Authors")]
public class Author
{
    [Column(Name = "Id", IsPrimaryKey = true, IsDbGenerated = true)]
    public int Id { get; set; }

    [Column(Name = "FirstName")]
    public string FirstName { get; set; }

    [Column(Name = "LastName")]
    public string LastName { get; set; }
}

[Table(Name = "Books")]
public class Book
{
    [Column(Name = "Id", IsPrimaryKey = true, IsDbGenerated = true)]
    public int Id { get; set; }

    [Column(Name = "Title")]
    public string Title { get; set; }

    [Column(Name = "Price")]
    public decimal Price { get; set; }

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

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