EntityFramework_MVC4中EF5 新手入门教程之一 ---1.创建实体框架数据模型

Contoso University  Web 应用程序

你会在这些教程中构建的应用程序是一个简单的大学网站。

用户可以查看和更新学生、 课程和教师信息。这里有几个屏幕,您将创建。

这个网站的用户界面样式一直接近由内置的模板,生成的内容,以便本教程可以集中主要精力如何使用实体框架。

系统必备组件

方向和屏幕截图在本教程中假定您正在使用Visual Studio 2012Visual Studio 2012 速成网站,最新的更新与截至 2013 年 7 月,安装的 Windows Azure SDK。你可以得到这一切与下面的链接:

Windows Azure SDK 以 Visual Studio 2012

如果你有安装了 Visual Studio,上面的链接将安装任何缺少的组件。如果你没有 Visual Studio,该链接将安装 Visual Studio 2012 速成网站。您可以使用 Visual Studio 2013 年,但某些所需的程序和屏幕会有所不同。

创建 MVC Web 应用程序

打开 Visual Studio 并创建一个新 C# 项目命名为"ContosoUniversity"使用ASP.NET MVC 4 Web 应用程序模板。请确保您的目标.NET 框架 4.5 (你会使用enum的属性,并且,需要.NET 4.5)。

新的 ASP.NET MVC 4 项目对话框中选择的互联网应用模板。

Razor视图引擎选择,和创建一个单元测试项目的复选框处于清除状态的假期。

单击确定.

建立了该网站的风格

几个简单的改变将设立网站菜单、 布局和主页。

打开Views\Shared\_Layout.cshtml,然后用以下代码替换该文件的内容。突出显示所做的更改。

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - Contoso University</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">@Html.ActionLink("Contoso University", "Index", "Home")</p>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
                        <ul id="menu">
                            <li>@Html.ActionLink("Home", "Index", "Home")</li>
                            <li>@Html.ActionLink("About", "About", "Home")</li>
                            <li>@Html.ActionLink("Students", "Index", "Student")</li>
                            <li>@Html.ActionLink("Courses", "Index", "Course")</li>
                            <li>@Html.ActionLink("Instructors", "Index", "Instructor")</li>
                            <li>@Html.ActionLink("Departments", "Index", "Department")</li>
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - Contoso University</p>
                </div>
            </div>
        </footer>

        @Scripts.Render("~/bundles/jquery")
        @RenderSection("scripts", required: false)
    </body>
</html>

这段代码进行以下更改:

  • "我的 ASP.NET MVC 应用程序"和"您的徽标在这里"的模板实例替换为"Contoso University"。
  • 添加将使用在本教程后面的几个操作环节。

Views\Home\Index.cshtml,用以下代码,以消除有关 ASP.NET 和 MVC 模板段落替换该文件的内容:

@{
    ViewBag.Title = "Home Page";
}
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
        </div>
    </section>
}

Controllers\HomeController.cs,将值更改为ViewBag.Message Index操作方法中为"欢迎来到 Contoso 大学 !",如下面的示例所示:

public ActionResult Index()
{
    ViewBag.Message = "Welcome to Contoso University";

    return View();
}

按 CTRL + F5 以运行网站。你看到主页与主菜单。

创建数据模型

接下来,您将创建实体类为 Contoso University 中的应用。你将开始与以下三个实体:

还有StudentEnrollment实体之间的一个一对多关系和CourseEnrollment实体之间是一对多的关系。换句话说,学生可以在任意数量的课程,并当然可以有任意数量的学生参加了它。

在以下部分中,您将创建一个类,用于每个这些实体。

如果您尝试编译该项目,在您完成所有这些实体类的创建之前,你就会得到编译器错误。

学生实体

模型文件夹中,创建Student.cs和现有代码替换为以下代码:

using System;
using System.Collections.Generic;

namespace ContosoUniversity.Models
{
    public class Student
    {
        public int StudentID { get; set; }
        public string LastName { get; set; }
        public string FirstMidName { get; set; }
        public DateTime EnrollmentDate { get; set; }

        public virtual ICollection<Enrollment> Enrollments { get; set; }
    }
}

StudentID属性将成为此类对应的数据库表的主键列。默认情况下,实体框架将解释是命名的ID类名ID作为主键的属性。

Enrollments属性是一个导航属性。导航属性持有此实体相关的其他实体。在这种情况下,一个Student实体的Enrollments属性将保留所有的Enrollment实体的那个Student实体相关的。换言之,如果某一给定的Student行在数据库中有两个相关的Enrollment行 (包含在其StudentID的外键列中的那个学生主键值的行),该Student实体Enrollments导航属性将包含这两个Enrollment实体。

导航属性通常定义为virtual中,以便他们可以利用某些实体框架功能,如延迟加载。(延迟加载将稍后解释,读取相关数据教程稍后在本系列中。

如果一个导航属性可以容纳多个实体 (如多多或一个一对多关系),其类型必须是一个列表条目可以被添加、 删除和更新,如ICollection.

注册实体

模型文件夹中,创建Enrollment.cs和现有代码替换为以下代码:

namespace ContosoUniversity.Models
{
    public enum Grade
    {
        A, B, C, D, F
    }

    public class Enrollment
    {
        public int EnrollmentID { get; set; }
        public int CourseID { get; set; }
        public int StudentID { get; set; }
        public Grade? Grade { get; set; }

        public virtual Course Course { get; set; }
        public virtual Student Student { get; set; }
    }
}

等级属性是枚举。问号后Grade类型声明指示Grade属性是可以为 null。为 null 的品位是不同于零级 — — null 意味着等级不为人知或没有被指派。

StudentID属性是一个外键,且相应的导航属性是StudentEnrollment实体是与一个Student实体相关联,所以该属性只能容纳一个单一的Student实体 (不像Student.Enrollments导航属性你前面所述,而数组可以存放多个Enrollment实体)。

CourseID属性是一个外键,且相应的导航属性CourseEnrollment实体是与一个Course实体相关联。

课程实体

模型文件夹中,创建Course.cs,现有代码替换为以下代码:

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace ContosoUniversity.Models
{
    public class Course
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int CourseID { get; set; }
        public string Title { get; set; }
        public int Credits { get; set; }

        public virtual ICollection<Enrollment> Enrollments { get; set; }
    }
}

Enrollments属性是一个导航属性。Course实体可以与任意数量的Enrollment实体。

我们会说更多关于[DatabaseGenerated(DatabaseGeneratedOption.None)] 在接下来的教程中的属性。基本上,此属性允许您为该课程而不是生成的数据库输入的主键。

创建Database Context

坐标给定的数据模型的实体框架功能的主类是数据库上下文类。通过从System.Data.Entity.DbContext类派生来创建此类。在您的代码中您指定数据模型中包括哪些实体。您还可以自定义某些实体框架行为。在这个项目中,类名为SchoolContext.

创建一个文件夹命名DAL (为数据访问层)。在该文件夹中创建一个新的类文件,命名为SchoolContext.cs,和现有的代码替换为以下代码:

using ContosoUniversity.Models;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace ContosoUniversity.DAL
{
    public class SchoolContext : DbContext
    {
        public DbSet<Student> Students { get; set; }
        public DbSet<Enrollment> Enrollments { get; set; }
        public DbSet<Course> Courses { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}

此代码创建一个DbSet属性为每个实体集。在实体框架术语中,实体集通常对应于数据库表,和一个实体对应于表中的一行。

OnModelCreating方法中的modelBuilder.Conventions.Remove语句可以防止表名称正在趋向多元化。如果你不这样做,所生成的表将命名为StudentsCoursesEnrollments。相反,表名称将是StudentCourse、 及Enrollment。表名称应该多数开发商不同意。本教程使用的是单数形式,但重要的一点是您可以选择哪个你更喜欢通过包括或省略下面这行代码的形式。

SQL 服务器快递 LocalDB

LocalDB是一个轻量级版本 SQL Server 表示数据库引擎的按需启动和运行在用户模式下。LocalDB 运行的 SQL Server Express 使您能够使用数据库的.mdf文件作为特殊的执行方式。通常情况下,LocalDB 数据库文件保存在 web 项目的App_Data文件夹中。在 SQL Server Express用户实例功能还使您能够使用.mdf文件,但不推荐使用用户实例的功能 ;因此,LocalDB 被推荐使用的.mdf文件。

通常 SQL Server Express 的并不用于生产的 web 应用程序。LocalDB 尤其不推荐用于生产一个 web 应用程序因为它不设计工作的非法入境者。

在 Visual Studio 2012 及以后的版本中,默认情况下,Visual Studio 安装 LocalDB。在 Visual Studio 2010 及更早版本中,在默认情况下,Visual Studio ; 安装 SQL Server Express (无 LocalDB)您必须手动安装它,如果你使用的 Visual Studio 2010。

在本教程中您将使用 LocalDB,以便数据库可以存储在.mdf文件所在的App_Data文件夹中。打开根Web.config文件并到connectionStrings集合中,添加一个新的连接字符串,如下面的示例所示。(请确保您更新Web.config文件中的根项目文件夹。此外,还有 Web.config文件是您不需要更新的视图子文件夹中。)

 <add name="SchoolContext" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=ContosoUniversity;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ContosoUniversity.mdf" providerName="System.Data.SqlClient" />

默认情况下,实体框架查找名为DbContext类 (此项目SchoolContext ) 相同的连接字符串。您已经添加的连接字符串指定一个名为ContosoUniversity.mdf位于App_Data文件夹中的 LocalDB 数据库。更多的信息,请参见ASP.NET Web 应用程序的 SQL 服务器连接字符串.

实际上,您不需要指定的连接字符串。如果您不提供连接字符串,实体框架将创建一个为您 ;但是,数据库可能无法在您的应用程序的App_data文件夹中。将创建数据库的信息,请参见代码第一次到新的数据库.

connectionStrings集合还具有一个名为DefaultConnection的用于成员资格数据库的连接字符串。在本教程中,您不会使用成员资格数据库。两个连接字符串之间的唯一区别是数据库名称和名称属性值。

设置和执行代码第一次迁移

当你第一次开始开发应用程序时,您的数据模型更改频繁,而且每次获取与数据库不同步的模型更改。您可以配置实体框架可以自动删除并重新创建该数据库的每次更改数据模型。这不是一个问题在开发的早期,因为测试数据是很容易重新创建,但是您已经部署到生产后你通常想要更新数据库架构,而不删除数据库。迁移功能使代码第一要更新数据库,而不会删除并重新创建它。早在开发周期中的一个新的项目你可能想要使用DropCreateDatabaseIfModelChanges ,可以删除、 重新创建和重新设置为种子数据库每次模型更改。一个人,你准备部署您的应用程序,您可以转换为的迁移方法。在本教程中,您将仅使用迁移。有关的详细信息,请参见代码第一次迁移迁移截屏视频系列.

启用代码第一次迁移

  1. 工具菜单上,单击库程序包管理器,然后程序包管理器控制台.

  2. PM>提示符下输入以下命令:
    enable-migrations -contexttypename SchoolContext

    此命令在 ContosoUniversity 项目中,创建一个迁移文件夹和它在该文件夹中放一个Configuration.cs文件,您可以编辑配置迁移。

    Configuration类包括创建数据库时,每次更新数据模型更改后调用的Seed方法。

    internal sealed class Configuration : DbMigrationsConfiguration<ContosoUniversity.Models.SchoolContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }
    
        protected override void Seed(ContosoUniversity.Models.SchoolContext context)
        {
            //  This method will be called after migrating to the latest version.
    
            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
        }
    }

    Seed方法的目的是使您能够向数据库中插入测试数据后代码第一次创建或更新它。

建立了种子法

种子方法运行时代码第一次迁移创建数据库和每一次它将更新到最新的迁移数据库。种子法的目的是为了使您能够将数据插入到表之前应用程序访问数据库第一次。

在早期版本的代码优先,迁移被释放之前,它是平常的Seed方法来插入测试数据,因为在开发过程中的每个模型修改数据库不得不被完全删除和重新创建从零开始。与代码第一次迁移,测试数据保留后数据库更改,因此包括种子方法中的测试数据通常不是必需。事实上,你不想要插入测试数据,如果您将使用迁移将数据库部署到生产,因为Seed方法将运行在生产中的Seed 方法。在这种情况下你希望Seed 方法向数据库中插入你想要在生产中插入的数据。例如,您可能想要包括实际部门名称Department表中,当应用程序在生产中可用的数据库。

对于本教程,您将使用迁移的部署,但你的Seed 方法将插入测试数据无论如何为了使它更加轻松地查看应用程序的功能而无需手动插入大量的数据的工作。

  1. Configuration.cs文件的内容替换为以下代码中,将测试数据加载到新的数据库。

    namespace ContosoUniversity.Migrations
    {
       using System;
       using System.Collections.Generic;
       using System.Data.Entity.Migrations;
       using System.Linq;
       using ContosoUniversity.Models;
    
       internal sealed class Configuration : DbMigrationsConfiguration<ContosoUniversity.DAL.SchoolContext>
       {
          public Configuration()
          {
             AutomaticMigrationsEnabled = false;
          }
    
          protected override void Seed(ContosoUniversity.DAL.SchoolContext context)
          {
             var students = new List<Student>
                {
                    new Student { FirstMidName = "Carson",   LastName = "Alexander",
                        EnrollmentDate = DateTime.Parse("2010-09-01") },
                    new Student { FirstMidName = "Meredith", LastName = "Alonso",
                        EnrollmentDate = DateTime.Parse("2012-09-01") },
                    new Student { FirstMidName = "Arturo",   LastName = "Anand",
                        EnrollmentDate = DateTime.Parse("2013-09-01") },
                    new Student { FirstMidName = "Gytis",    LastName = "Barzdukas",
                        EnrollmentDate = DateTime.Parse("2012-09-01") },
                    new Student { FirstMidName = "Yan",      LastName = "Li",
                        EnrollmentDate = DateTime.Parse("2012-09-01") },
                    new Student { FirstMidName = "Peggy",    LastName = "Justice",
                        EnrollmentDate = DateTime.Parse("2011-09-01") },
                    new Student { FirstMidName = "Laura",    LastName = "Norman",
                        EnrollmentDate = DateTime.Parse("2013-09-01") },
                    new Student { FirstMidName = "Nino",     LastName = "Olivetto",
                        EnrollmentDate = DateTime.Parse("2005-08-11") }
                };
             students.ForEach(s => context.Students.AddOrUpdate(p => p.LastName, s));
             context.SaveChanges();
    
             var courses = new List<Course>
                {
                    new Course {CourseID = 1050, Title = "Chemistry",      Credits = 3, },
                    new Course {CourseID = 4022, Title = "Microeconomics", Credits = 3, },
                    new Course {CourseID = 4041, Title = "Macroeconomics", Credits = 3, },
                    new Course {CourseID=1045,Title="Calculus",Credits=4,},newCourse{CourseID=3141,Title="Trigonometry",Credits=4,},newCourse{CourseID=2021,Title="Composition",Credits=3,},newCourse{CourseID=2042,Title="Literature",Credits=4,}};
             courses.ForEach(s => context.Courses.AddOrUpdate(p => p.Title, s));
             context.SaveChanges();var enrollments =newList<Enrollment>{newEnrollment{StudentID= students.Single(s => s.LastName=="Alexander").StudentID,CourseID= courses.Single(c => c.Title=="Chemistry").CourseID,Grade=Grade.A
                    },newEnrollment{StudentID= students.Single(s => s.LastName=="Alexander").StudentID,CourseID= courses.Single(c => c.Title=="Microeconomics").CourseID,Grade=Grade.C
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Alexander").StudentID,CourseID= courses.Single(c => c.Title=="Macroeconomics").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Alonso").StudentID,CourseID= courses.Single(c => c.Title=="Calculus").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Alonso").StudentID,CourseID= courses.Single(c => c.Title=="Trigonometry").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Alonso").StudentID,CourseID= courses.Single(c => c.Title=="Composition").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Anand").StudentID,CourseID= courses.Single(c => c.Title=="Chemistry").CourseID},newEnrollment{StudentID= students.Single(s => s.LastName=="Anand").StudentID,CourseID= courses.Single(c => c.Title=="Microeconomics").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Barzdukas").StudentID,CourseID= courses.Single(c => c.Title=="Chemistry").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Li").StudentID,CourseID= courses.Single(c => c.Title=="Composition").CourseID,Grade=Grade.B
                     },newEnrollment{StudentID= students.Single(s => s.LastName=="Justice").StudentID,CourseID= courses.Single(c => c.Title=="Literature").CourseID,Grade=Grade.B
                     }};foreach(Enrollment e in enrollments){var enrollmentInDataBase = context.Enrollments.Where(
                    s =>
                         s.Student.StudentID== e.StudentID&&
                         s.Course.CourseID== e.CourseID).SingleOrDefault();if(enrollmentInDataBase ==null){
                   context.Enrollments.Add(e);}}
             context.SaveChanges();}}}

    种子方法采用数据库上下文对象作为输入参数和方法中的代码使用该对象来向数据库中添加新的实体。代码为每个实体类型,创建一个新的实体的集合,将它们添加到适当的DbSet属性,然后将所做的更改保存到数据库。这是没有必要后每个组的实体,调用SaveChanges方法,因为在这里,但这样做可以帮助你找到问题的根源,如果向数据库写入代码时发生的异常。

    一些插入数据的语句使用AddOrUpdate方法执行"upsert"操作。因为Seed 方法运行与每个迁移时,你不能只是将数据插入,因为您试图添加的行就已经在那里创建数据库的第一次迁移后。"Upsert"操作可以防止错误如果您尝试插入行已经存在,但它将重写将会发生任何更改你可能已经在测试应用程序时的数据。用测试数据在某些表中您可能不希望这样的事情发生: 在某些情况下当您更改数据在测试时你想要更改数据库更新后继续。在这种情况下,你想要做一个有条件的插入操作: 插入行,只有当它不存在。种子方法使用这两种方法。

    第一个参数传递给AddOrUpdate方法指定要用来检查是否已存在的行的属性。为您提供的学生 (测试) 数据,LastName属性可以用于此目的因为每个列表中的最后一个名称是唯一的:

    context.Students.AddOrUpdate(p => p.LastName, s)

    此代码假定最后一名是唯一的。如果您手动添加具有重复的姓氏的一名学生,你会得到下面的异常下次您执行迁移。

    序列包含一个以上的元素

    AddOrUpdate方法的更多信息,请参阅在 Julie Lerman 博客上的照顾与 EF 4.3 AddOrUpdate 方法

    添加Enrollment实体的代码不使用 AddOrUpdate方法。它会检查是否实体已经存在,并且插入实体,如果它不存在。这种方法将保留到入学年级迁移运行时所做的更改。代码遍历每个成员的Enrollment 列表,如果在数据库中找不到注册,它向数据库中添加注册。第一次你更新数据库,数据库将为空,所以它将添加每个招生。

    foreach (Enrollment e in enrollments)
    {
        var enrollmentInDataBase = context.Enrollments.Where(
            s => s.Student.StudentID == e.Student.StudentID &&
                 s.Course.CourseID == e.Course.CourseID).SingleOrDefault();
        if (enrollmentInDataBase == null)
        {
            context.Enrollments.Add(e);
        }
    }

    有关如何调试Seed 方法以及如何处理多余的数据,如命名为"亚历山大 · 卡森"的两个学生的信息,请参阅在里克 • 安德森的博客上的播种及调试实体框架 (EF) 星展银行

  2. 生成项目。

创建和执行第一次迁移

  1. 在程序包管理器控制台窗口中,输入以下命令:

    add-migration InitialCreate
    update-database

    add-migration命令将添加到迁移文件夹[DateStamp]_InitialCreate.cs文件,其中包含创建数据库的代码。第一个参数 (InitialCreate)用于文件的名称,并且可以是任何你想要的 ;你通常选择的单词或短语总结了正在做迁移中。例如,您可能会命名以后迁移"AddDepartmentTable"。

    UpInitialCreate类的方法创建的数据库表,对应于数据模型实体集,并 Down方法删除它们。迁移调用Up方法来执行数据模型更改为迁移。当你输入一个命令来回滚更新时,迁移调用Down方法。下面的代码演示了InitialCreate 文件的内容:

    namespace ContosoUniversity.Migrations
    {
        using System;
        using System.Data.Entity.Migrations;
    
        public partial class InitialCreate : DbMigration
        {
            public override void Up()
            {
                CreateTable(
                    "dbo.Student",
                    c => new
                        {
                            StudentID = c.Int(nullable: false, identity: true),
                            LastName = c.String(),
                            FirstMidName = c.String(),
                            EnrollmentDate = c.DateTime(nullable: false),
                        })
                    .PrimaryKey(t => t.StudentID);
    
                CreateTable(
                    "dbo.Enrollment",
                    c => new
                        {
                            EnrollmentID = c.Int(nullable: false, identity: true),
                            CourseID = c.Int(nullable: false),
                            StudentID = c.Int(nullable: false),
                            Grade = c.Int(),
                        })
                    .PrimaryKey(t => t.EnrollmentID)
                    .ForeignKey("dbo.Course", t => t.CourseID, cascadeDelete: true)
                    .ForeignKey("dbo.Student", t => t.StudentID, cascadeDelete: true)
                    .Index(t => t.CourseID)
                    .Index(t => t.StudentID);
    
                CreateTable(
                    "dbo.Course",
                    c => new
                        {
                            CourseID = c.Int(nullable: false),
                            Title = c.String(),
                            Credits = c.Int(nullable: false),
                        })
                    .PrimaryKey(t => t.CourseID);
    
            }
    
            public override void Down()
            {
                DropIndex("dbo.Enrollment", new[] { "StudentID" });
                DropIndex("dbo.Enrollment", new[] { "CourseID" });
                DropForeignKey("dbo.Enrollment", "StudentID", "dbo.Student");
                DropForeignKey("dbo.Enrollment", "CourseID", "dbo.Course");
                DropTable("dbo.Course");
                DropTable("dbo.Enrollment");
                DropTable("dbo.Student");
            }
        }
    }

    update-database命令运行Up方法来创建数据库,然后它运行Seed 方法来填充该数据库。

现在前,该署为您的数据模型,创建一个 SQL Server 数据库。数据库的名称是ContosoUniversity,和.mdf文件是在您的项目的App_Data文件夹中,因为那是您在您的连接字符串中指定。

你可以使用服务器资源管理器SQL 服务器对象资源管理器(SSOX) 在 Visual Studio 中查看的数据库。在本教程中,您将使用服务器资源管理器。在 Visual Studio 表达 2012 网站,服务器资源管理器调用数据库资源管理器.

  1. 视图菜单上,单击服务器资源管理器.
  2. 单击添加连接图标。

  3. 如果系统提示您与选择数据源对话框中,单击Microsoft SQL Server,然后单击继续.

  4. 添加连接对话框中,输入服务器名称 (localdb) \v11.0 。在选择或输入数据库名称下,选择ContosoUniversity.

  5. 单击OK。
  6. 展开SchoolContext ,然后展开.

  7. 右键单击学生表,单击显示表数据,请参阅创建列和被插入到表中的行。

创建学生控制器和视图

下一步是创建 ASP.NET MVC 控制器和视图在您的应用程序可以使用这些表之一。

  1. 若要创建一个Student控制器,用鼠标右键单击控制器文件夹中的解决方案资源管理器中,选择添加,,然后单击控制器。在添加控制器对话框中,选择以下选项,然后单击添加:

    • 控制器的名称: StudentController.
    • 模板: MVC 控制器的读/写操作和视图,使用实体框架.
    • 模型类:学生 (ContosoUniversity.Models)。(如果看不到此选项在下拉列表中的,生成项目,并再试一次)。
    • 数据上下文类: SchoolContext (ContosoUniversity.Models).
    • 视图:Razor (CSHTML)。(默认值)。

  2. Visual Studio 会打开Controllers\StudentController.cs文件。你看到一个类变量已创建该实例化数据库上下文对象:
    private SchoolContext db = new SchoolContext();

    Index操作方法从学生实体通过读取数据库上下文实例Students属性设置获取学生列表:

     public ViewResult Index()
    {
        return View(db.Students.ToList());
    }

    Student\Index.cshtml视图显示此列表的表中:

    <table>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.LastName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.FirstMidName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.EnrollmentDate)
            </th>
            <th></th>
        </tr>
    
    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.LastName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.FirstMidName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.EnrollmentDate)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.StudentID }) |
                @Html.ActionLink("Details", "Details", new { id=item.StudentID }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.StudentID })
            </td>
        </tr>
    }
  3. 按 CTRL + F5 以运行该项目。

    单击学生选项卡以查看 Seed方法插入的测试数据。

公约

由于采用了各项公约或使实体框架的假设,你不得不为实体框架,以便能够为您创建一个完整的数据库按顺序写的代码量很小。其中一些已经被注意到:

  • 多元化的形式的实体类的名字被用作表名称。
  • 实体属性名称用于列的名称。
  • 被命名为ID类名ID的实体属性被视为首要的关键属性。

你见过可以覆盖公约 (例如,您指定不应该多元化表名称),并且您将了解更多关于各项公约以及如何创建一个更复杂的数据模型后来在这个系列教程中重写它们。更多的信息,请参阅代码第一次约定.

摘要

现在,您已经创建一个简单的应用程序,使用实体框架和 SQL Server Express 来存储和显示数据。在下面的教程中,您将学习如何执行基本的 CRUD (创建、 读取、 更新、 删除) 操作。你可以离开此页面底部的反馈。请让我们知道如何你喜欢本教程的这一部分,我们如何能改善它。

a{right:0;position:absolute;top:5px}.common-list-horz li.icon-announce{width:65px;min-height:65px;background:url(../images/ui/home-announcements-icon.png?cdn_id=i72) 0 0 no-repeat #969696}.common-list-horz li.icon-spotlight-lrg{display:block;text-decoration:none;width:45px;height:40px;background:url(../images/ui/dialog.png?cdn_id=i72) 0 0 no-repeat transparent;position:relative;margin-left:7px;margin-right:30px;margin-top:-10px}.common-list-horz li.icon-whatsnew-lrg{display:block;text-decoration:none;width:40px;height:40px;background:url(../images/ui/icon_new.png?cdn_id=i72) 0 0 no-repeat transparent;position:relative;margin-left:7px;margin-right:30px;margin-top:-10px}.common-list-horz li.icon-announcements-lrg{display:block;text-decoration:none;width:40px;height:40px;background:url(../images/ui/icon_announcement.png?cdn_id=i72) 0 0 no-repeat transparent;position:relative;margin-left:7px;margin-right:30px;margin-top:-10px}.common-list-horz .common-section-head{margin:0;padding:0;border:0}.get-started .hero{margin-bottom:45px;padding:35px 0 0 40px;width:1140px;height:215px;background-color:#efefef}.get-started .hero h1{margin-bottom:12px;font-size:32px;color:#000}.get-started .hero>p{margin-bottom:30px}.get-started .col-left{width:820px;padding:0 30px 0 0;border-right:1px solid #d2d2d2}.get-started .col-right{width:300px;padding:0 0 0 29px}.get-started .landing-nav{width:100%;border-top:1px solid #d2d2d2;margin-bottom:30px;padding:11px 0 0 0}.get-started .landing-nav:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.get-started .landing-nav h2{margin-bottom:14px;font-size:1.308em;font-weight:bold}.get-started .landing-nav h3{font-weight:bold;line-height:1;margin-bottom:7px}.get-started .landing-nav .excerpt{margin:0;color:#000;min-height:125px}.get-started .landing-nav a.tech-model{display:block}.get-started .landing-nav a.tech-model:hover{background-color:#f0f0f0;text-decoration:none}.get-started .landing-nav a.tech-model h3{color:#267cb2}.get-started .landing-nav a.tech-model:hover h3{text-decoration:underline}.get-started .landing-nav .module-one-col{width:202px;float:left;margin-right:30px}.get-started .landing-nav .module-two-col{width:368px;float:left}.get-started .module-two-col .module-left{margin-right:10px}.get-started .module-two-col .module-left,.get-started .module-two-col .module-right{width:178px;float:left}.get-started .btn-install .label{padding-left:5px}.get-started .content-mod{border-bottom:1px solid #d2d2d2;padding-bottom:30px;margin:0 0 30px 0;overflow:hidden}.get-started .content-mod div{margin-right:39px;width:23%}.get-started .content-mod div.content-txt{min-width:67%}.get-started .content-mod div.float-left{float:left}.get-started .content-mod div.float-right{float:right}.get-started .content-mod a.thumb-vid{border:1px solid #d2d2d2;display:block;width:189px;height:107px;background:url(../images/ui/get-started-thumb-fpo.png?cdn_id=i72) 0 0 no-repeat transparent}.get-started .content-mod a.thumb-vid.websites{background-image:url(../images/ui/getstarted-thumb-websites.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.api{background-image:url(../images/ui/getstarted-thumb-api.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.realtime{background-image:url(../images/ui/getstarted-thumb-realtime.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.mobile{background-image:url(../images/ui/getstarted-thumb-mobile.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.tools{background-image:url(../images/ui/getstarted-thumb-tools.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.webforms{background-image:url(../images/ui/getstarted-thumb-web-forms.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.mvc{background-image:url(../images/ui/getstarted-thumb-mvc.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid.webpages{background-image:url(../images/ui/getstarted-thumb-wmx.png?cdn_id=i72)}.get-started .content-mod a.thumb-vid span{display:block;width:189px;height:107px;background:url(../images/ui/get-started-play-icon.png?cdn_id=i72) center center no-repeat transparent}.get-started .content-mod h2,.customer-mod h2,.case-studies-mod h2{font-size:18px;font-weight:600;color:#000}.module-intro h3{font-size:1.308em;font-weight:bold;margin-bottom:14px}.module-intro .post-thumb{margin:0 16px 5px 0}.get-started .col-left .play-button{background-position:-219px 148px}.get-started .col-left .play-button:hover{background-position:-820px 148px}.get-started .col-right .play-button{background-position:-442px 36px}.get-started .col-right .play-button:hover{background-position:-1043px 36px}.module-jumpstart .post-thumb{float:none}.module-jumpstart img{width:100%}.module-jumpstart .post-duration{font-size:1em;margin-top:5px}.module-jumpstart{color:#363636;margin-bottom:50px}.module-jumpstart h2{font-size:1em;text-transform:uppercase;color:#363636;margin-bottom:8px;font-weight:bold}.customer-mod .border-bottom,.module-jumpstart .border-bottom{border-bottom:1px solid #d2d2d2;padding:0 0 14px 0;margin:0 0 30px 0}.module-jumpstart .border-bottom{margin-bottom:15px}.customer-mod-list{width:810px;height:320px;list-style:none;margin:0 0 30px 0;border-bottom:1px solid #d2d2d2}.customer-mod-list li{float:left;width:202px;height:90px}.customer-mod-list a{margin:10% auto;display:block;text-indent:-999em;background:url(../images/content/ASP-NET-Customers.png?cdn_id=i72) no-repeat 0 -999em}.customer-mod-list .logo-woot{width:118px;height:41px;top:25%;background-position:0 -12px}.customer-mod-list .logo-cheezburger{width:81px;height:57px;left:269px;background-position:-269px -10px}.customer-mod-list .logo-3m{width:86px;height:49px;left:516px;top:8px;background-position:-516px -8px}.customer-mod-list .logo-getty-images{width:112px;height:28px;left:1px;top:109px;background-position:-1px -109px}.customer-mod-list .logo-thinkstock{width:129px;height:27px;left:242px;top:109px;background-position:-242px -109px}.customer-mod-list .logo-stackoverflow{width:127px;height:38px;left:475px;top:97px;background-position:-475px -97px}.customer-mod-list .logo-british-museum{width:94px;height:52px;left:0;top:172px;background-position:0 -172px}.customer-mod-list .logo-kbb{width:128px;height:49px;left:247px;top:181px;background-position:-244px -181px}.customer-mod-list .logo-usair{width:143px;height:17px;left:462px;top:197px;background-position:-462px -197px}.customer-mod-list .logo-bing{width:82px;height:38px;left:4px;top:281px;background-position:-2px -281px}.customer-mod-list .logo-xbox{width:89px;height:55px;left:270px;top:267px;background-position:-270px -267px}.customer-mod-list .logo-msnbc{width:112px;height:28px;left:493px;top:276px;background-position:-493px -276px}.post-thumb{display:block;float:left;position:relative}.samples h1{color:#000;background:#fff;padding-bottom:10px;margin:0 0 5px 0}.samples .col-left{width:820px;padding:0 30px 0 0;border-right:1px solid #d2d2d2}.samples .col-right{width:300px;padding:0 0 0 29px}.samples .content-wrap{padding:20px 25px 0 0}.samples .content-wrap .common-post{min-height:1%;border-bottom:1px solid #d2d2d2;padding:0 0 22px 0}.samples .content-wrap .common-post h3,.samples .content-wrap .common-post p{margin:0 5px 5px 90px}.samples .content-wrap a img{margin:15px 0 0 20px}.chapter-content .common-post{min-height:1%;padding:0 0 25px 0;margin:0}.learn .hero{margin:-40px 0 40px 0;padding:35px 0 0 40px;width:1140px;height:215px;background-color:#0054a3}.learn .hero-small.webmatrix{background:url(../images/ui/webmatrix-icon-small.png?cdn_id=i72) 10px 7px no-repeat #004082}.learn .hero-small-2{color:#fff}.learn .hero-small-2 a{color:#6cb200}.learn .hero .hero-leftcontent h1{margin-bottom:12px;font-size:32px;color:#fff}.learn .hero .hero-leftcontent p{margin-bottom:30px;color:#fff}.module-chapters{width:239px;float:left;border-right:1px solid #d2d2d2}.module-chapters.extended{width:315px;float:left}.module-chapters .ad a{color:#2186c6}.content-box{padding:5px 15px 5px 15px;border-left:1px solid #d2d2d2;border-right:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;background:#3a597c}.chapter-box h2{color:#fff;font-size:1.077em}.chapter-box ol,.content-box ul{margin:0;list-style:none}.content-box li{margin:0}.content-box a{display:block;margin:0 -15px;padding:5px 20px}.content-box a:hover{background:#2b496c;text-decoration:none}.content-box a.selected{background:#2b496c}.chap-num{display:block;float:left}.chap-title{display:block;margin-left:15px}.chap-title.greater-than-ten{margin-left:22px}.sponsor-box{display:block;width:185px;padding:20px;background-color:#d2d2d2;font-size:12px;color:#505050;cursor:pointer}.chapter-title{color:#363636;font-size:1.385em;font-weight:500;margin-bottom:16px;line-height:1.3em}.chapter-heading{font-weight:normal;color:#737d86;font-size:1.077em;font-weight:300;margin-bottom:10px}.chapter-content{margin:30px 0 0 30px}.toc-menu{margin-bottom:40px}.toc-menu ul{list-style:none;margin:0;overflow:hidden}.toc-menu ul ul{display:none}.toc-menu ul ul.active{display:block;margin:0}.toc-menu ul li{position:relative}.toc-menu ul li a{color:#000;display:block;font-size:14px;line-height:21px;padding:2px 0 7px 30px;text-decoration:none}.toc-menu ul li a.hasNew{padding-right:34px}.toc-menu ul.articles li a{padding-left:40px;padding-right:20px}.toc-menu ul.articles li a.hasNew{padding-right:34px}.toc-menu ul.subsections li a{padding-left:50px}.toc-menu ul.lists li a{padding:0 20px 0 60px;line-height:20px;margin-bottom:10px}.toc-menu ul li a.arrow{padding-right:0;width:30px;height:17px;position:absolute;top:0;left:-30px}.toc-menu ul li a.arrow span,.toc-menu ul li a.arrow.expanded span,.toc-menu ul li a.arrow.expanded.hover span,.toc-menu ul li a.arrow.hover span{display:block;margin:8px 0 0 10px;width:7px;height:7px;background:url(../images/ui/learn-toc-sprite.png?cdn_id=i72) 0 -7px no-repeat transparent}.toc-menu ul li a.arrow.expanded span{background-position:0 0}.toc-menu ul li a.arrow.expanded.hover span{background-position:0 -16px}.toc-menu ul li a.arrow.hover span{background-position:0 -23px}.toc-menu ul li a.hover{background-color:#0054a3;color:#fff}.toc-menu ul.lists li a.arrow span{background:none}.learn .col-main{width:820px;overflow:hidden;padding-right:30px;border-right:1px solid #d2d2d2}.learn .col-center{width:576px;border-left:1px solid #d2d2d2;margin-left:-1px}.learn .col-right{width:300px;padding:0 0 0 28px;border-left:1px solid #d2d2d2;margin-left:-1px}.important{background:none repeat scroll 0 0 #e7f4ff;border:1px solid #c9ddfa;margin:0 0 20px;padding:12px 15px}.important-heading{background:#ccc;font-size:16px;padding:6px 30px;margin:0 -35px 0 0;font-weight:bold}.important-heading p{margin:0}.important-description{background:url(../images/ui/chapter-icon.png?cdn_id=i72) 30px 25px no-repeat #eee;font-size:14px;color:#000;padding:25px 30px 25px 130px;margin-right:-35px;min-height:55px}.note,.sidebar{background:#ffffec;border:1px solid #e9e8c8;margin:18px 85px 18px 0;padding:12px 15px;position:relative}.note .dogear,.sidebar .dogear{height:14px;width:15px;z-index:1;display:block;position:absolute;top:-1px;right:-2px;background:url(../images/ui/sprite-article.png?cdn_id=i72) no-repeat 0 0}.note p,.sidebar p{margin:10px 0}.note strong,.sidebar strong{color:#000}.important .note .dogear{display:none}.common-list-steps.no-bullets{padding:0}.common-list-steps.no-bullets li{border-top:1px solid #d2d2d2;margin:20px 0 0 30px;padding:20px 0 0 0}.common-list-steps.no-bullets li:first-child{border:0;padding-top:10px}.common-list-steps.no-bullets li li,.common-list-steps.no-bullets li li:first-child{border:0;margin:0;padding:0}.common-list-steps.no-bullets li h3{font-size:16px;font-weight:600;margin-bottom:10px}.common-list-steps.no-bullets li h3 a.hasNew{padding-right:30px}.common-list-steps.no-bullets li p{font-size:14px;color:#000}.common-list-steps.no-bullets li p.details{margin-bottom:3px;font-size:12px;color:#505050}.col-right .keyline{margin:0 0 25px 0}.col-right-learn .social-bar{float:right}.col-right-learn .social-bar img{margin:-5px 0 0 0}.details{margin:0}.summary{margin-bottom:18px}.tbl-action{border:1px solid #e2e4e6;border-collapse:collapse}.tbl-action th{background:#f1f1f1;border-bottom:1px solid #e2e4e6;border-left:1px solid #e2e4e6;padding:10px 17px;font-weight:normal}.tbl-action th:first-child{border-left:1px solid #e2e4e6}.tbl-action td{padding:14px 17px;border-bottom:1px solid #e2e4e6;border-left:1px solid #e2e4e6}.tbl-action td:first-child{background:#f8f8f8;border-left:1px solid #e2e4e6}.module-confirm,.module-error,.module-processing{padding:18px 20px;margin-bottom:12px;text-align:center}.module-confirm p,.module-error p,.module-processing p{margin:0}.module-confirm{color:#000;background:#f3fce3;border:1px solid #cee1af}.module-processing{color:#000;background:#fff6bf;border:1px solid #ffd324}.module-error{color:#eb6666;background:#ffe5e5;border:1px solid #eb6666}.leave-feedback{width:400px;float:right}#comment-submit .common-btn{float:left;margin-top:3px}.leave-comment{border-top:1px solid #e5e5e5;width:100%;padding:30px 0 0 0}.leave-comment:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.leave-comment.module-comment .module-confirm{clear:both;margin-top:15px}.leave-comment.module-comment .module-error{clear:both;margin-top:15px}.leave-comment.module-comment .module-processing{clear:both;margin-top:15px}.leave-comment.module-comment .module-error p{clear:both}.leave-comment.module-comment .col-left{margin-right:0;border-right:0}.leave-comment.module-comment .col-right{width:518px;padding-left:0;margin-bottom:10px}.leave-comment.module-comment .col-comment:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.article-comments.module-comment .col-left{width:170px;padding:0;color:#737d86;margin-right:0;border-right:0}.article-comments.module-comment .col-right{width:500px;padding-left:0;margin-bottom:10px;float:left}.leave-comment .col-left h2{color:#737d86;font-size:1.308em;margin-bottom:5px}.module-comment{clear:both}.module-comment .col-left{width:100%;padding:0;color:#737d86}.module-comment .col-right{width:518px;padding-left:17px}.module-comment label{font-size:.923em}.module-comment-header{padding-bottom:5px;border-bottom:1px solid #d2d2d2}a.show-comments{font-size:.75em;float:right;margin-top:2px}.comments-status{float:left;margin-left:5px;margin-top:2px;clear:none;font-size:.75em;font-weight:bold;color:#507cbd}.article-comments{border-top:1px solid #d2d2d2;padding:22px 0 20px 0;color:#737d86}.article-comments .col-left{color:#737d86;margin:0;margin-top:1px;width:140px}.article-comments .col-left h2{font-size:1.308em}.article-comments .col-right{font-size:1.308em;margin:0}.article-comments .col-right a{vertical-align:middle}.article-comments ul{margin:0;list-style:none;clear:both;padding:0 0 10px 0}.article-comments li{width:100%;border-bottom:1px solid #c1c1c1;padding:10px 0;margin:0;position:relative}.article-comments li:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.article-comments li img{float:left;margin:0 0 0 80px}.article-comments li p{margin:0 0 9px 160px}.comment-details-left{float:left}.comment-details-right a{float:right;cursor:pointer;font-style:italic}#comment-list li img{float:left;margin:5px 0 9px 50px}.author-box.article{border-top:1px solid #e5e5e5;padding:22px 0}.download-box-article{border:1px solid #cee0b1;background:#f3fce4;margin:0 0 15px;padding:12px 15px;display:inline-block;position:relative;color:#242525;text-align:center}.download-box-article p{margin:0;font-size:1em;font-weight:600}.download-box-article .module-common-select{position:absolute;top:45px;left:50%;margin-left:-82px;width:auto;text-align:left}.download-box-article .common-select{width:164px}.article-content img{max-width:675px}.article-content .important ul{margin:0 0 0 15px;padding:0}.article-content .details-box.important ul{margin:0 0 18px 30px}.article-content ul ul{margin:5px 0 0 30px}.article-content li img{display:block;margin:18px 0}.article-content li .note,.article-content li .sidebar{margin-top:35px}.article-content li table{margin-top:10px}.article-content table{border:1px solid #e2e4e6;border-collapse:collapse}.article-content table th{background:#f1f1f1;border-bottom:1px solid #e2e4e6;border-left:1px solid #e2e4e6;padding:10px 17px;font-weight:normal;color:#242525}.article-content table th:first-child{border-left:1px solid #e2e4e6}.article-content table td{padding:14px 17px;border-bottom:1px solid #e2e4e6;border-left:1px solid #e2e4e6}.article-content table td:first-child{background:#f8f8f8;border-left:1px solid #e2e4e6}.article-content h1{margin-bottom:10px;font-size:32px;color:#000}.article-content h3{font-size:1.231em;margin-bottom:10px}.article-content h4{font-size:1.077em;margin-bottom:10px;font-style:italic}.article-content .common-sidebar-module h3{font-size:1em}h4.label{padding-top:10px}.article-content p.intro{font-size:14px;color:#000}.article-page-multi .col-left{width:230px;padding-right:23px}.article-page-multi .col-right{width:697px}.article-page-multi .article-title{width:676px}.article-page-multi .ad-120x90{width:240px;position:absolute;top:-25px;right:-274px}.article-content .common-sidebar-module h4{font-size:13px;font-style:normal}.article-page .col-left{overflow:hidden;padding-right:30px;border-right:1px solid #d2d2d2}.caption{display:block;margin-bottom:30px}.video-thumb-single{display:block;font-size:.846em;position:absolute;cursor:pointer;top:0;right:0}.video-thumb-single:hover{text-decoration:none}.video-thumb-single img{margin:0}.video-thumb-single .play_button{background-position:20px 11px}.video-thumb-single .play_button:hover{background-position:-150px 11px}p.video_thumb{position:relative;overflow:visible;padding:0 90px 0 0}.accordion:hover{cursor:pointer}.accordion span{display:inline-block;width:7px;height:7px;background:url(../images/ui/learn-toc-sprite.png?cdn_id=i72) no-repeat 0 -7px;margin-right:2px;margin-top:0;position:relative;top:-3px}.accordion.open span{background-position:0 0}.mark-fav{color:#fe9b00;background:url(../images/ui/sprite-sharebar-small.png?cdn_id=i72) no-repeat 0 1px;padding:0 0 2px 15px}.mark-complete{color:#3cae03;background:url(../images/ui/sprite-sharebar-small.png?cdn_id=i72) no-repeat 0 -39px;padding:0 0 2px 15px}.module-vid-player{padding:14px 15px;margin:0 0 20px 0;border:1px solid #d2d2d2;background:#eee;width:643px}.module-vid-player img{display:block;margin:0}.module-vid-details{position:relative}.author-box{clear:both;padding:15px 0 0 0}.author-box img{float:left;margin:3px 0 0 50px;width:59px;height:59px}.author-box p{margin:0 0 0 138px}.curricula-list-sidebar h2{font-size:1em;font-weight:bold;text-transform:uppercase;margin:0 0 3px 0;color:#969696}.curricula-list-sidebar p{margin:0}.curricula-list-sidebar p.details{margin:0 0 5px -10px;padding:0 0 10px 10px;font-size:1em;color:#868686;font-style:italic}.curricula-list-sidebar ol{margin:0 0 40px 0;list-style:none;background:#23517c}.curricula-list-sidebar ol a{display:block;padding:15px 20px 15px 43px;color:#fff}.curricula-list-sidebar ol a:hover{text-decoration:none;background-color:#3f688d}.curricula-list-sidebar ol a.selected{background-color:#3f688d}.curricula-list-sidebar li{margin-bottom:0}.curricula-list-sidebar .icon-curricula{background-position:-7985px 17px}.curricula-list-sidebar .icon-video{background-position:-7185px 15px}.curricula-list-sidebar .icon-book{background-position:-1185px 50%}.curricula-list-sidebar .icon-link{background-position:-1785px 50%}.curricula-list-sidebar .icon-whitepaper{background-position:-19585px 50%}.curricula-list-sidebar .icon-wizard{background-position:-4185px 50%}.article-title{margin:0 0 14px 0;width:100%;position:relative;z-index:1}.article-title.keyline{height:auto;background:none;border-bottom:1px solid #d2d2d2;padding-bottom:8px}.article-title:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.article-title h1{margin-bottom:10px;line-height:1.2em}.article-title h1.hasNew{padding-right:56px}.article-title .details{padding:1px 0 0 0;color:#707070}.article-title .details .author-header{width:63%}.social-shares{position:relative}.article-title .social-shares{float:right}.article-title .rate-results{font-size:11px;color:#9a9fa2}.article-title .rate-results a{margin-left:10px;font-size:12px}.content #rate-topic,#rate-confirm{font-family:‘Segoe Semibold‘;background:#fff;position:relative;z-index:2;float:left;font-size:11px;color:#535d65}.content #rate-topic strong{font-weight:normal;float:left;padding:7px 10px 7px 15px;border:1px solid #d2d2d2;border-right-width:0}.content #rate-topic a{background:url(../images/ui/share-sprite.png?cdn_id=i72) 5px 8px no-repeat;float:left;text-decoration:none;color:#2186c6;padding:7px 10px 7px 30px;margin-left:-1px;border:1px solid #d2d2d2;border-width:1px;border-color:#dadada transparent;margin-right:-1px}.content #rate-topic a:hover{background-color:#fafafa;border-color:#dadada}.content #rate-topic a+a{background-position:5px -19px;border-right-color:#dadada}.content #rate-topic a span{color:#7f7f7f;text-decoration:none}.content #rate-topic a.active,.content #rate-topic a.completed{border-color:#dadada;border-bottom-color:#fff;background-position:5px -44px}.content #rate-topic a+a.active,.content #rate-topic a+a.completed{background-position:5px -71px}.content #rate-topic a.completed{border-bottom-color:#dadada}.feedback-form{display:none;font-family:‘Segoe Semibold‘;z-index:1;background:#fff;position:absolute;left:0;top:33px;border:1px solid #d2d2d2;width:643px;padding:15px}.feedback-form textarea{display:block;width:630px;min-height:120px;resize:none;border:1px solid #d2d2d2;padding:5px}.feedback-form input[type=checkbox]{float:left;display:none}.feedback-form input[type=checkbox]+label{cursor:pointer;color:#535d65;padding:5px 10px 5px 20px;float:left;background:url(../images/ui/share-sprite.png?cdn_id=i72) 0 -98px no-repeat;margin:0 10px 10px 0}.feedback-form input[type=checkbox]:checked+label{background-position:0 -122px}.feedback-form input[type="checkbox"]+label.checked{background-position:0 -122px}.feedback-form .area-label{clear:both;color:#535d65;display:block;margin-bottom:10px}.feedback-form .btn-social{cursor:pointer;border:1px solid #d2d2d2;color:#2186c6;padding:8px 14px;border-radius:5px;box-shadow:-1px -1px 0 #fafafa;background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f5f5f5));background-image:-webkit-linear-gradient(top,#fff,#f5f5f5);background-image:-moz-linear-gradient(top,#fff,#f5f5f5);background-image:-ms-linear-gradient(top,#fff,#f5f5f5);background-image:-o-linear-gradient(top,#fff,#f5f5f5);background-image:linear-gradient(to bottom,#fff,#f5f5f5)}.feedback-form .btn-social:hover{background-color:#f5f5f5;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#fff));background-image:-webkit-linear-gradient(top,#f5f5f5,#fff);background-image:-moz-linear-gradient(top,#f5f5f5,#fff);background-image:-ms-linear-gradient(top,#f5f5f5,#fff);background-image:-o-linear-gradient(top,#f5f5f5,#fff);background-image:linear-gradient(to bottom,#f5f5f5,#fff)}#rate-confirm{font-style:italic;border:1px solid #d2d2d2;padding:7px;margin:0;text-indent:10px}.feedback-form .btn-social:active{background:#f0f0f0}.feedback-form .btn-social+.btn-social{margin-left:20px}.feedback-form div{margin-top:10px;float:right}.nav-multi-part{border-top:1px solid #d2d2d2;list-style:none;margin:0;width:100%}.nav-multi-part:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.nav-multi-part li{float:left;width:33.33%;margin:0;text-align:center;position:relative}.nav-multi-part li.current{padding:20px 0}.nav-multi-part li.current span{padding-top:6px}.nav-multi-part li.next a,.nav-multi-part li.prev a{padding:20px 0;width:100%;display:block;text-decoration:none}.nav-multi-part li.next a:hover,.nav-multi-part li.prev a:hover{background:#f2f3f4}.nav-multi-part li.next a span,.nav-multi-part li.prev span{color:#000}.nav-multi-part li span{font-size:1.231em;display:block;margin-bottom:7px}.nav-multi-part li.current span.icon{width:12px;height:8px;left:50%;top:0;margin-left:-6px;position:absolute;background:url(../images/ui/sprite-article.png?cdn_id=i72) no-repeat 0 -16px}.nav-multi-part li .arrow{font-size:1.4em;line-height:1;display:inline;margin:0;position:relative;top:1px}.downloads h1{margin-bottom:10px;width:780px}.downloads .col-left{width:820px;padding:0 30px 0 0;margin-top:15px;border-right:1px solid #d2d2d2;min-height:650px}.downloads .col-right{width:300px;padding:0 0 0 29px}.downloads .landing-featured{width:100%;border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;margin-bottom:18px;padding-top:15px}.downloads .landing-featured:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.landing-featured .col-left{float:left;width:305px;border:0;padding:0;margin:0;min-height:0}.landing-featured .col-right{float:right;width:280px;border:0;padding:0;margin:0}.landing-featured h2{font-size:1.385em;color:#676767;margin-bottom:8px}.landing-featured .play-button{background-position:-381px 70px}.landing-featured .play-button:hover{background-position:-982px 70px}.common-checklist{list-style:none;margin:0 0 20px 0}.common-checklist li{padding-left:23px;background:url(../images/ui/sprite-icons.png?cdn_id=i72) no-repeat -6000px 2px}.smallprint{color:#a9a9a9;font-size:.846em}.hosted h1{border-bottom:1px solid #d2d2d2;padding-bottom:10px;margin-bottom:10px}.hosted.two-col .col-left{padding:0;width:676px;border-right:0}.hosted .col-left .subhero img{margin:0 0 0 0}.hosted .col-left .subhero{border-top:1px solid #c8c8c8;border-bottom:1px solid #4d4e51;padding:45px 0 0 50px;width:626px;height:216px;background-color:#0378d6}.hosted .col-left .subhero h2{margin:0 0 15px 0;font-family:‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;color:#fff;font-size:24px;line-height:24px}.hosted .col-left .subhero h3{margin:10px 0 15px 0;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;color:#fff;font-size:40px;font-weight:100;line-height:40px}.hosted .col-left .subhero p{margin:0 0 0 0;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;color:#fff;font-size:20px;font-weight:100;line-height:20px}.hosted.two-col .col-right{width:326px}.hosted .col-right .subhero{border-top:1px solid #c8c8c8;border-bottom:1px solid #4d4e51;background-color:#5c2c91;width:297px;height:221px;padding:40px 28px 0 28px}.hosted .col-right .subhero h3{margin:0 0 20px 0;color:#fff;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;font-size:30px;line-height:30px;font-weight:100}.hosted .col-right .subhero p{margin:0 0 0 0;color:#fff;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;font-size:16px;line-height:22px;font-weight:100}.hosted .subhero a.btn-azure{margin:25px 0 0 0;clear:both;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;line-height:35px;font-size:20px;display:inline-block;text-decoration:none;font-weight:100;position:relative;color:#fff;background:url(../images/ui/azure_CTA-white.png?cdn_id=i72) no-repeat 96% center #a5ce00;padding:7px 55px 7px 10px}.hosted .subhero a.btn-azure:hover{background-color:#89c402;transition:all .1s ease-in-out 0s}.hosted .heading{margin-top:25px}.hero{margin-bottom:45px;padding:35px 0 0 40px;width:1140px;height:215px;background-color:#efefef}.hero-leftcontent{float:left;height:100%;width:800px;margin-right:50px;position:relative}.hero-rightcontent{float:right;height:100%;width:850px}.hero-leftimage{float:left;height:100%;width:290px}.hero-rightimage{float:right;height:100%;width:290px}.hero-rightimage img,.two-col .hero-leftimage img{margin:auto;display:block}.hero-rightimage.video a{position:relative;width:246px;height:200px;display:block}.hero-rightimage.video .play-button{background-position:-400px 78px}.hero-rightimage.video .play-button:hover{background-position:-1000px 78px}.hero-small{position:absolute;bottom:25px;width:500px;height:38px;background:url(../images/ui/aspnet-icon-small.png?cdn_id=i72) 10px 10px no-repeat #68217a;margin:0 0 10px 0}.hero-small h2,.two-col .hero-small p{color:#fff;padding-left:52px;font-size:14px}.hero-small h2{float:left;padding-top:12px;font-weight:700;width:370;color:#fff;padding-left:40px;font-size:14px;margin-bottom:3px}.hero-small a{float:right;font-size:12px;padding:4px 15px;margin:6px 10px 0 0}.hero-small-2{position:absolute;top:152px;left:512px;font-size:12px}.hero-small-2 a{font-weight:bold}.hero h1{margin-bottom:12px;font-size:32px;color:#000}.hero>p{margin-bottom:30px}.two-col .col-left{width:785px;padding:0 30px 0 35px;border-right:1px solid #d2d2d2}.two-col .col-right{width:300px;padding:0 0 0 29px}.two-col h3{margin:30px 0 15px 0;font-size:20px}.two-col ul{margin:0 0 30px 18px}.two-col ul li{font-size:14px;margin:15px 0 15px 0}.two-col div.divider{height:1px;background-color:#d2d2d2;width:820px;position:relative;left:-35px;clear:both}.two-col div.spacer{height:1px;background-color:transparent;width:820px;clear:both}.pluralsight .hero{background-color:#0054a3}.pluralsight .hero-small{width:813px;height:58px;background:url(../images/ui/pluralsight-hardcoredevtraining.png?cdn_id=i72) 4px 3px no-repeat #fff;margin:0 0 10px 0}.pluralsight .hero p{margin-bottom:30px;color:#fff}.pluralsight .hero-small h2,.pluralsight .hero-small p{color:#f26521;padding-left:226px;font-size:14px}.pluralsight .hero-small h2{float:none;padding-top:11px;margin-bottom:3px;font-weight:bold}.pluralsight .hero-small a{float:right;margin:-62px 12px 0 0;font-size:12px;padding-bottom:6px;padding-top:6px}.pluralsight .hero .hero-small p{color:#f26521}.pluralsight .hero h1{margin-bottom:12px;font-size:32px;color:#fff}.pluralsight .hero .hero-rightimage img{margin-top:-6px}.pluralsight .col-left{width:785px;padding:0 30px 0 35px;border-right:1px solid #d2d2d2}.pluralsight .col-right{width:300px;padding:0 0 0 29px}.pluralsight h3{margin:30px 0 0 0;font-size:18px}.pluralsight ul.two-column-list{margin:5px 0 30px 0;list-style-type:none;clear:both;overflow:visible;width:800px}.pluralsight ul.two-column-list li{font-size:14px;margin:5px 0 5px 0;float:left;display:block;width:338px;margin-right:46px}.pluralsight div.divider{height:1px;background-color:#d2d2d2;width:1145px;position:relative;left:-35px;margin:45px 0}.pluralsight div.spacer{height:1px;background-color:transparent;width:820px}.pluralsight.content .col-full{padding-left:35px}.pluralsight.content .quotecallout{font-style:italic;font-size:15px}.pluralsight.content .quoteattribution{font-weight:bold}.pluralsight.content .calltoaction{position:relative;height:120px}.pluralsight.content .calltoaction img{margin-right:20px}.pluralsight.content .calltoaction p{font-size:22px;font-weight:100;font-family:‘Segoe UI Light‘,‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;margin:0 0 10px 0}.pluralsight.content .calltoaction strong{font-size:16px;font-weight:400;margin:0 0 10px 0;display:block}.pluralsight.content .calltoaction a.btn-install{position:absolute;bottom:0;left:140px;margin:0 0 0 0}.pluralsight.content .calltoaction a.btn-install.second{position:absolute;bottom:0;left:300px;margin:0 0 0 0}.search h1{background:none repeat scroll 0 0 #fff;color:#000;display:inline-block;padding-right:10px;margin-bottom:13px;font-size:30px}.search h2{background:none repeat scroll 0 0 #fff;color:#000;display:inline-block;padding-left:30px;font-size:40px}.search .col-left{width:300px;padding:0 30px 0 0}.search .col-right{width:820px;padding:0 0 0 30px}.search-results{margin:0 30px 0 0;list-style:none;padding:0 0 0 25px}.search-results li{margin-bottom:18px;position:relative}.search-results .resultnumber{position:absolute;left:-40px;font-size:16px;color:#505050;top:0}.search-results h3{font-size:1.154em;margin-bottom:5px;font-weight:bold}.search-results h3 span{font-size:13px;font-weight:normal}.search-results p{margin-bottom:0}.search-filter{background:#f0f0f0;border:1px solid #d2d2d2}.search-facet{padding:10px;width:290px}.search-facet:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.search-facet.scroll-pane{height:155px;overflow:auto;padding:0 10px;margin:10px 0}.search-filter h2{background:#333;color:#fff;margin:0;font-size:1.154em;padding:10px 75px 10px 10px;position:relative}.search-filter h3{background:#dfdfdf url(../images/ui/sprite-search.png?cdn_id=i72) no-repeat 17px -35px;border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2;box-shadow:inset 0 -1px #d9d9d9;-webkit-box-shadow:inset 0 -1px #d9d9d9;-moz-box-shadow:inset 0 -1px #d9d9d9;color:#000;font-weight:normal;padding:6px 10px 6px 35px;cursor:pointer;margin:0}.search-filter h3.last{border-bottom:0}.search-filter h3.show{background:#dfdfdf url(../images/ui/sprite-search.png?cdn_id=i72) no-repeat 17px -76px}.search-filter p{margin:0;width:100%}.search-filter p:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.search-filter .common-checkbox{float:left;margin-right:8px;margin-top:0}.search-filter .common-label{display:block;line-height:1;margin:0 0 6px 4px;padding:0;font-weight:normal}.search-filter .count{color:#9d9d9d;font-size:.769em}.search-filter img{margin:0}.search-filter .search-box{position:relative}.search-filter .search-box:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.search-filter .search-box label{color:#4597cb;margin:3px 5px 0 0;display:block;float:left}.search-box p.search-fields{background:#fff;height:23px;border:1px solid #d2d2d2;display:block;width:207px;float:left}.search-box .input-search-text{border:0;padding:4px 4px 0 4px;display:block;float:left;width:170px;color:#707070}.search-box .input-search-submit{width:28px;height:23px;display:block;float:right;background:url(../images/ui/sprite-search.png?cdn_id=i72) no-repeat 0 0;border:0;cursor:pointer}.search .searchdivider{border-bottom:#969696 solid 1px;width:825px;position:relative}.search .searchdivider img{position:absolute;right:20px;top:-45px}.search .sortingoptions{text-align:right;margin:15px 0 15px 0;width:825px;font-size:14px}.search .sortingoptions span{color:#272727}.btn-clear{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;border:1px solid #d2d2d2;color:#fff!important;display:inline-block;float:right;font-size:.846em;padding:4px 0;position:relative;right:-6px;text-align:center;text-decoration:none;top:-2px;width:54px;background:#bababa url(../images/ui/sprite-btn-clear.png?cdn_id=i72) repeat-x 0 0;cursor:pointer;line-height:1}.btn-clear:hover{text-decoration:none;background-color:#aeaeae;background-position:0 -30px}.btn-clear:active{background-position:0 -60px;background-color:#ccc}h2 .btn-clear{font-size:.733em;border:1px solid #d2d2d2;background-position:0 -90px;background-color:#4e4e4e;position:absolute;top:6px;right:4px}h2 .btn-clear:hover{background-position:0 -120px;background-color:#484848}h2 .btn-clear:active{background-position:0 -150px;background-color:#777}.search-facet-author .search-box p.search-fields{width:193px}.search-facet-author .search-box .input-search-text{width:156px}.search-facet-author .search-dropdown{width:193px;top:32px;left:104px;z-index:2}.search-box .search-dropdown a{padding:4px 9px}.search-facet-date .search-facet label{color:#4597cb;font-size:.923em;display:block}.search-facet-date .search-facet input{line-height:1;border:1px solid #d2d2d2;padding:4px 6px;width:120px;color:#707070}.search-facet-date .search-facet p{width:140px;float:left}.common-label{font-weight:bold;padding-bottom:3px}.pagination{width:551px;border:1px solid #d2d2d2;margin-bottom:25px;background-color:#fff;margin-left:28px}.pagination:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.pagination a,.pagination span.nolink,.pagination .disabled{display:block;width:38px;height:27px;padding-top:12px;float:left;text-align:center;line-height:1}.pagination a{color:#267cb2}.pagination .prev{width:75px!important;margin-right:9px;border-right:1px solid #d2d2d2;text-transform:uppercase;color:#000}.pagination .next{width:75px!important;margin-left:10px;border-left:1px solid #d2d2d2;text-transform:uppercase;color:#000;float:right}.pagination a span{color:#69c2ec}.pagination a:hover{background:#dcdcdc;text-decoration:none}.pagination a.selected{background:#dcdcdc;color:#000}.pagination .disabled{color:#bfbfbf}.recognition h1{background:none repeat scroll 0 0 #fff;display:inline-block;margin-bottom:30px;padding-right:10px}.recognition .tbl-action .col1{width:13%}.recognition .tbl-action .col2{width:16%}.recognition .tbl-action .col3{width:61%}.recognition .tbl-action .col4{text-align:center}.recognition .tbl-action td{vertical-align:middle}.icon-level-member{height:12px;width:60px;background:url(../images/ui/sprite-level-ratings.png?cdn_id=i72) no-repeat 0 1px}.icon-level-participant{height:12px;width:60px;background:url(../images/ui/sprite-level-ratings.png?cdn_id=i72) no-repeat 0 -14px}.icon-level-contributor{height:12px;width:60px;background:url(../images/ui/sprite-level-ratings.png?cdn_id=i72) no-repeat 0 -29px}.icon-level-star{height:12px;width:60px;background:url(../images/ui/sprite-level-ratings.png?cdn_id=i72) no-repeat 0 -44px}.icon-level-all-star{height:12px;width:60px;background:url(../images/ui/sprite-level-ratings.png?cdn_id=i72) no-repeat 0 -59px}.icon-level-member span,.icon-level-participant span,.icon-level-contributor span,.icon-level-star span,.icon-level-all-star span{position:absolute;left:-999em}.module-whos-online h2 a{font-size:.923em;text-transform:lowercase}.tbl-whos-online td{vertical-align:middle}.tbl-whos-online .avatar{display:block;float:left;margin:3px 10px 8px 0}.recog-level-key{width:100%;margin-bottom:18px}.recog-level-key:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.recog-level-key p{font-size:.923em}.recognition h3{text-transform:uppercase;margin-bottom:5px}.tbl-recognition{float:left;width:360px;margin-right:24px}.tbl-recognition th{padding:5px 9px;font-weight:normal;text-transform:uppercase;background:#f3f3f3;border-top:1px solid #a4a4a4;border-bottom:1px solid #a4a4a4;font-weight:bold}.tbl-recognition td{border-bottom:1px solid #a4a4a4;border-left:1px solid #e3e3e3;font-size:.923em;padding:5px 9px}.tbl-recognition td:first-child{border-left:0;background:none}.dl-common dt{margin-bottom:18px}.dl-common dd{margin-bottom:18px}.module-top-movers{margin-bottom:5px}.hof .module-top-movers h3{font-size:1em;text-transform:none;margin-bottom:5px}.tbl-top-movers .col1{width:16%}.tbl-top-movers .col2{width:63%}.tbl-top-movers .col3{width:21%}.module-common-select{padding-bottom:20px;width:100%;position:relative}.module-common-select:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.common-tbl{border-collapse:collapse;width:100%}.common-tbl thead th{background:#f3f3f3;font-weight:bold;white-space:nowrap}.common-tbl th{font-weight:normal;padding:5px 9px;border-top:1px solid #a4a4a4;border-bottom:1px solid #a4a4a4;text-transform:uppercase}.common-tbl td{border-bottom:1px solid #c1c1c1;padding:10px 12px;line-height:1;vertical-align:middle;font-size:.923em;color:#000}.common-tbl .last td{border-bottom:0}.common-tbl h2,.common-tbl h3{font-size:1.083em;margin:0 0 5px 0;font-weight:normal}.common-tbl p{margin:0;color:#82878d}.common-tbl p a{color:#587935}.hof .col-left{width:820px;padding-right:30px;border-right:1px solid #d2d2d2}.hof .col-right{width:300px}.hof h1{color:#000;font-size:32px;margin-bottom:10px}.hof h3{font-size:1.538em;margin-bottom:15px}.hof .tbl-action{border:0}.hof .tbl-action th{background:#f3f3f3;border-top:1px solid #a4a4a4;border-bottom:1px solid #a4a4a4;border-left:0;text-transform:uppercase;padding:5px 9px;font-weight:bold}.hof .tbl-action td{border-bottom:1px solid #a4a4a4;border-left:1px solid #e3e3e3;font-size:.923em;padding:5px 9px}.hof .tbl-action td:first-child{border-left:0;background:none}.tbl-top-movers{border:0}.tbl-top-movers th{background:#f3f3f3;border-top:1px solid #a4a4a4;border-bottom:1px solid #a4a4a4;border-left:0;text-transform:uppercase;padding:5px 9px;font-weight:bold}.tbl-top-movers td{border-bottom:1px solid #a4a4a4;border-left:1px solid #e3e3e3;font-size:.923em;padding:5px 9px}.tbl-top-movers td:first-child{border-left:0;background:none}.common-tbl-hof td{border-bottom:1px solid #a4a4a4}.common-tbl-hof td:first-child{font-size:1em;font-weight:bold;width:63%}.common-tbl-hof td.col2{width:13%}.hof .busy{background-position:center 50px}.module-pbl .tbl-recognition th{background:none;border-top:none;border-bottom:0;text-transform:none;color:#343434;padding-left:0}.module-pbl .tbl-recognition td{padding-left:0;border:0;line-height:1;padding:4px 0;font-size:1em}.module-pbl h2{margin-bottom:0}.module-pbl .tbl-recognition{width:295px}.sort-box{position:relative}.sort-box h2{font-size:1em;color:#000}.sort-box .module-common-select{position:absolute;right:0;top:-6px;width:auto;z-index:1}.two-col.downloads .hero-leftcontent{width:885px;margin-right:0}.two-col.downloads .hero-rightimage{width:250px}.downloads .doublelists{float:left;width:50%;margin:0 0 20px 0}.two-col.downloads ul{list-style:none;margin:0}.two-col.downloads .divider{margin:10px 0;left:0;width:100%}.two-col.downloads .hero-rightimage img{margin-top:-17px}.module-download{width:100%}.module-download:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.module-download h2{font-size:1em;text-transform:uppercase;font-weight:bold;margin-bottom:6px}.module-download ul{margin:0 0 17px 0;list-style:none}.module-download li{margin-bottom:0}.module-download .common-module{width:275px;float:left;margin-right:25px}.module-download .common-module.last{margin:0}.social-avatar{width:59px}.icon-rss{display:block;padding:0 0 0 20px;background:url(../images/ui/sprite-icons.png?cdn_id=i72) -14100px 50%}.common-sidebar-module .tags{font-size:1em}.common-sidebar-module .common-list{margin:0 0 0 0;list-style:none;border:0;padding:0 0 0 0}.common-sidebar-module .common-list li{margin:0;padding:2px 0;border-top:1px solid #d2d2d2}.common-sidebar-module .common-list li.first{border-top:0}.common-sidebar-module .common-list .count{font-size:.833em}.common-sidebar-module .common-list .selected a{color:#fff;background:#23517c;display:block;padding:0 8px;margin-left:-8px;text-decoration:none!important}.common-sidebar-module .common-post{margin:0 0 17px 0;min-height:0;padding:0}.common-sidebar-module .common-list.eventslist li{clear:both;border:none;vertical-align:top;margin:0 0 25px 0}.common-sidebar-module .common-list.eventslist li h3{float:left;position:relative;top:2px;font-weight:500}.common-sidebar-module .common-list.eventslist li p{margin:0 0 5px 100px;font-size:11px}.common-sidebar-module .common-list.eventslist li p a{font-size:16px}.common-sidebar-module .common-list.eventslist li p.cta a{}.common-sidebar-module .common-list.topmovers li{clear:both;border:none;vertical-align:top;margin:0 0 25px 0}.common-sidebar-module .common-list.topmovers li img{float:left;position:relative;top:2px;font-weight:500}.common-sidebar-module .common-list.topmovers li p{margin:5px 0 5px 90px;font-size:11px}.common-sidebar-module .common-list.topmovers li p a{font-size:11px;color:#000}.common-sidebar-module .common-list.topmovers li p.cta a{font-size:16px;color:#267cb2}.common-sidebar-module .icon{display:inline-block;width:16px;height:16px;background:url(../images/ui/sprite-ui.png?cdn_id=i72) no-repeat -100px -100px;margin-left:2px;text-indent:-999em}.common-sidebar-module .common-list.topmovers li.viewall p a,.common-sidebar-module .common-list.eventslist li.viewall p a{font-size:11px;color:#000}.community .col-right div.spacer{width:300px}.comment-noEditor{font:1em ‘Segoe UI‘,Tahoma,Arial,Helvetica,sans-serif;width:502px;height:126px;margin:0;padding:7px;border:1px solid #d2d2d2;margin-bottom:20px;resize:none}.community .head-desc{margin-bottom:40px;color:#000;font-size:14px}.community h1{color:#000;font-size:32px;margin-bottom:10px}.community .col-left{border-right:1px solid #d2d2d2}.community .common-post{min-height:1%;border-bottom:1px solid #d2d2d2;padding:15px 0 35px}.community .common-post.blog-post{padding:10px 0 20px}.community .common-post p{margin-left:90px}.community .common-post.last{border-bottom:0}.community .common-post h2{margin:0 0 5px 90px;font-size:16px;font-weight:600}.community .common-post .details{font-size:11px;font-weight:normal;margin-bottom:4px}.community .common-post img.social-avatar{padding:0}.community .seemore{margin:-20px 0 40px 0;font-size:14px}.community .leftside .seemore,.community .rightside .seemore{position:absolute;bottom:0;left:0;font-size:14px;margin:0 0 18px 0}.community .leftside,.community .rightside{float:left;width:370px;margin-right:40px;margin-bottom:20px;position:relative;padding-bottom:30px}.community .leftside .common-post,.community .rightside .common-post{border:none;margin:10px 0;padding:8px 0 8px 0;height:120px}.community .common-post.small{height:auto}.community div.spacer{background-color:transparent;clear:both;height:1px;width:820px;margin:20px 0 40px}.community div.divider{height:1px;background-color:#d2d2d2;width:820px;clear:both;margin:20px 0 40px}.fl-menu{position:absolute;top:230px;left:10px;font-weight:bold}.fl-menu h2{margin-bottom:5px;font-weight:bold}.fl-menu a{color:#267cb2}.fl-menu a.disabled{color:#ccc;cursor:text}.fl-menu a:hover{text-decoration:none}.col-left-thin .fl-menu li{margin-bottom:3px}.community h1{color:#000;font-size:32px;margin-bottom:10px}.community h3{color:#000;font-size:22px;margin-bottom:20px}.community h3 .icon{top:3px;position:relative}.community .col-left{width:820px;border-right:1px solid #d2d2d2}.community .common-post .details{margin-bottom:5px}.module-community .common-post p,.module-community .common-post h3{margin:0 0 0 80px}.col-left-thin p{font-size:.923em;margin:0 0 12px 0}.col-left-thin ul{font-size:.923em;list-style:none;margin:0 0 25px 0}.col-left-thin li{margin:0}.col-left-thin .sharebox{padding:0}.col-left-thin .sharebox a.btn-share{-moz-border-radius:0;background:url("../images/ui/sprite-sharebar.png?cdn_id=i72") no-repeat scroll -3201px 50% transparent;border:0;display:block;line-height:inherit;padding:0 0 0 20px;position:relative}.col-left-thin .sharebox .flyout{left:60px;top:0}.btn-share:visited,.icon-rss:visited{color:#267cb2}.row-community{width:100%;padding-bottom:10px}.row-community:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.module-community{width:390px;min-height:390px;float:left;margin:0 15px 0 0;overflow:hidden}.module-community.even{margin:0}.module-community.autoheight{min-height:0;margin-bottom:0}.community-header{background:#f2f2f2;color:#555e66;font-size:1em;font-weight:bold;line-height:1;padding:6px 14px 6px 8px;border-bottom:1px solid #bfc4c9;margin:0 0 20px 0}.community-header a{font-size:.769em;font-weight:bold;color:#267cb2}.community-header.icon-rss-head a.icon{margin-left:4px;font-size:1em}.article-comments.module-comment .icon-rss-head a.icon{margin-left:4px;font-size:1em;text-align:left;vertical-align:middle}.common-post .details a.author{color:#587935}.module-community .ad-300x250{width:300px;margin:0 auto;padding:15px 0 0 0}.post-icon{width:70px;height:70px;background:url(../images/ui/sprite-icons-lg.png?cdn_id=i72) no-repeat -999em 50%;float:left}.post-icon.icon-compare{background-position:-600px 50%}.post-icon.icon-cal{background-position:0 50%}.post-icon.icon-control-gallery{background-position:-1198px 50%}.module-community .link-more{margin:2px 0 0 0;float:right}.module-community.module-community-participate .common-post{min-height:48px}.module-community.module-community-participate .post-icon{height:48px}.module-community.module-community-participate .details a{color:#000}.module-community.module-community-participate .details a:hover{text-decoration:none}.icon-comments{padding:0 0 0 13px;background:url(../images/ui/sprite-icons.png?cdn_id=i72) no-repeat -4200px 50%}.icon-retweet{padding:0 0 0 17px;background:url(../images/ui/sprite-icons.png?cdn_id=i72) no-repeat -4800px 50%}.icon-rate{padding:0 0 0 15px;background:url(../images/ui/sprite-icons.png?cdn_id=i72) no-repeat -5400px 50%}.common-post span.icon-level-member,.common-post span.icon-level-participant,.common-post span.icon-level-contributor,.common-post span.icon-level-star,.common-post span.icon-level-all-star{display:inline-block;margin-left:5px;position:relative;top:1px}.archives .head-desc{margin-bottom:45px;color:#000;font-size:14px}.archives h1{color:#000;font-size:32px;margin-bottom:10px}.archives .col-left{border-right:1px solid #d2d2d2}.archives .common-post{min-height:1%;border-bottom:1px solid #d2d2d2}.archives .common-post p{margin-left:80px}.archives .common-post.last{border-bottom:0}.archives .common-post h2{margin:0 0 3px 80px;font-size:16px;font-weight:600}.archives .common-post .details{color:#000;font-size:11px;font-weight:normal;margin-bottom:4px}.archives .common-post img.social-avatar{padding:0}.archive-content{width:100%;margin-bottom:15px}.archive-content:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.archive-content ul{margin:0 5px 0 0;width:100px;list-style:none;float:left}.archive-content li{margin:0}.archive-content .count{color:#000;font-size:.833em}.archives .ad-iab-txt{position:static;margin:0;float:right;padding-bottom:10px;width:305px}.archives .pagination{margin:20px 0 10px 80px}.terms h1{border-bottom:1px solid #d2d2d2;padding-bottom:15px;margin-bottom:16px}.terms .common-sidebar-module{font-size:1em;float:right;width:300px}.privacy h1{border-bottom:1px solid #d2d2d2;padding-bottom:15px;margin-bottom:16px}.module-privacy:first-child{border-right:1px solid #d2d2d2;border-left:0}.module-privacy{float:left;font-size:.923em;min-height:168px;padding:20px 17px;width:440px;border-left:1px solid #d9d9d9;margin-left:-1px}.module-privacy h2{font-size:1.5em}.row-privacy.first{border:medium none}.row-privacy{border-top:1px solid #d2d2d2;width:100%}.row-privacy:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.content-404{padding:34px 10px 20px 80px;width:880px;min-height:360px}.content-404 h1{padding:10px 0 16px 0;border-bottom:1px solid #d2d2d2}.icon-exclamation{display:block;width:44px;height:44px;background:url(../images/ui/sprite-error.png?cdn_id=i72) no-repeat 0 0;position:absolute;left:20px;top:40px}.content.contact-us{padding-bottom:94px}.contact-us h1{margin-bottom:40px;font-size:32px;color:#000}.contact-us .keyline-title{top:-20px}.contact-us .details{color:#8b8c8d;font-weight:bold;margin-bottom:20px}.icon-list,.icon2-list{float:left}.icon-list ul,.icon2-list ul{list-style:none;margin:0}.icon-list li,.icon2-list li{margin-bottom:10px}.icon-list li span,.icon2-list li span{display:inline-block;width:55px;height:55px;background:url(../images/ui/contact-icons-sprite.png?cdn_id=i72) 0 0 no-repeat #454545}.icon-list li span.c-a,.icon2-list li span.c-a{background-position:0 0}.icon-list li span.c-b,.icon2-list li span.c-b{background-position:0 -55px}.icon-list li span.c-c,.icon2-list li span.c-c{background-position:0 -110px}.icon-list li span.c-d,.icon2-list li span.c-d{background-position:0 -165px}.icon-list li span.c-e,.icon2-list li span.c-e{background-position:0 -220px}.icon-list li span.c-f,.icon2-list li span.c-f{background-position:0 -275px}.icon-list li a,.icon2-list li p{display:inline-block;height:55px;vertical-align:top;font-size:14px;font-weight:600;margin:0 0 0 15px}.icon2-list li a{display:block;margin-bottom:10px}.icon2-list li p{font-size:12px!important;width:690px}.icon2-list li p a{font-size:14px!important}.contact-us h2{border-bottom:1px solid #d2d2d2;padding-bottom:30px;margin-bottom:35px;font-size:22px;font-weight:600}.icon-list{width:415px}.icon2-list{width:765px}.quick-list a{display:block;font-size:14px;font-weight:600;margin-bottom:10px}@media only screen and (device-width:768px){.promo-box-wrapper li:hover a span{display:none}}.module-form-wrapper{width:780px;padding:20px;margin:50px 0 24px;position:relative;background:#f8f8f8;border:1px solid #e2e4e6}.module-form-wrapper h3{background:#f1f1f1;margin:-20px -20px 20px;padding:10px 10px 8px 8px;border-bottom:1px solid #e2e4e6}.form-wrapper p{margin:0;float:left;width:100%;clear:both;height:auto!important;min-height:36px;padding-bottom:10px}.form-wrapper label{float:left;width:150px;color:#000;display:block;padding-top:5px;font-weight:bold}.form-wrapper input.input_box,.form-wrapper textarea.txt_area{margin:0;float:left;width:230px;padding:5px;background-color:#fff;border:1px solid #dcdedf}.form-wrapper textarea.txt_area{width:360px;height:84px}.form-wrapper p.submit{padding:0;margin:0 0 0 150px}.form-wrapper .error{color:#eb6666}.form-wrapper span.required{color:#eb6666}.form-wrapper input.error{color:#eb6666;border:1px solid #eb6666}.form-wrapper textarea.error{color:#eb6666;border:1px solid #eb6666}.form-wrapper .error-container{display:none;background-color:#ffe5e5;border:1px solid #eb6666;margin-bottom:20px;padding:5px;color:#eb6666}.form-wrapper .error-container ol li{list-style-type:disc;margin-left:20px}.form-wrapper .error-container h4{color:#eb6666;font-weight:bold;margin:10px}.error-container label.error{display:inline;font-weight:normal}.error-container label{width:100%;float:none}.section-head{background:#f3f3f3;border-top:1px solid #d2d2d2;border-bottom:1px solid #d2d2d2}.col-left .section-head{font-size:.923em;text-transform:uppercase;font-weight:bold;padding:9px 30px 9px 12px;position:relative}.section-head.icon-rss-head .icon{position:absolute;top:8px;right:8px}.common-post.border-bottom{border-bottom:1px solid #d2d2d2;padding-bottom:0}.ajax .hero p{width:800px}.ajax .common-post{border-bottom:1px solid #d2d2d2;min-height:50px;padding-bottom:0;margin-bottom:25px}.ajax div.common-post:last-child{border-bottom:none}.ajax .common-post .excerpt{padding-bottom:17px;font-size:14px}.ajax .common-post.last .excerpt{border-bottom:0;padding-bottom:25px}.ajax p,.ajax h3{margin:0 0 0 0}.ajax h3{font-weight:600;font-size:16px;margin:0 0 5px 0}.ajax .icon-rss-head{position:relative;color:#000}.ajax .icon-rss-head .icon{top:10px;margin-left:20px}.ajax .author-attribution{}.ajax .author-attribution img{}.ajax .author-attribution h2{margin:0 0 25px 0}.ajax .author-attribution h3{margin:0 0 0 85px}.ajax .author-attribution p{margin:5px 0 0 85px}.mobile .hero-leftcontent{float:left;height:100%;width:700px}.mobile .hero-rightimage{float:right;height:100%;width:390px}.mobile .common-post{border-bottom:1px solid #d2d2d2;min-height:50px;padding-bottom:0;margin-bottom:25px}.mobile div.common-post:last-child{border-bottom:none}.mobile .common-post .excerpt{padding-bottom:17px;font-size:14px}.mobile .common-post.last .excerpt{border-bottom:0;padding-bottom:25px}.mobile p,.ajax h3{margin:0 0 0 0}.mobile h3{font-weight:600;font-size:16px;margin:0 0 5px 0}.mobile .icon-rss-head{position:relative;color:#000}.mobile .icon-rss-head .icon{top:10px;margin-left:20px}.mobile h2{margin:50px 0 25px 0;color:#000}.mobile h2:first-child{margin:0 0 25px 0;color:#000}.landing-ajax{width:100%;margin:0 0 15px 0;list-style:none}.landing-ajax:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.landing-ajax li{float:left;margin-bottom:0;width:280px}.landing-ajax li h2{font-size:1em;line-height:1.3em;margin-bottom:7px}.landing-ajax li h2 a{display:block;padding:90px 0 0 0}.landing-ajax li.control-kit{margin-right:40px;background:url(../images/ui/sprite-ajax.png?cdn_id=i72) no-repeat 80px 20px}.landing-ajax li.jquery{background:url(../images/ui/sprite-ajax.png?cdn_id=i72) no-repeat -630px 35px}.landing-ajax li.cdn{margin-right:40px;clear:both;background:url(../images/ui/sprite-ajax.png?cdn_id=i72) no-repeat -1288px 18px}.landing-ajax li.juice{background:url(../images/ui/sprite-ajax.png?cdn_id=i72) no-repeat -1761px 18px}.get-started .landing-nav h4{margin-bottom:6px}.get-started .landing-nav ul{margin:0 0 0 15px}.get-started .landing-nav li{margin:0}.get-started .landing-nav .bullets{color:#000;display:none}.tag1{font-size:x-large}.tag2{font-size:larger}.tag3{font-size:medium}.tag4{font-size:small}.vnext{margin-right:15px;padding:20px;color:#222;margin-bottom:40px;border:1px solid #d2d2d2}.vnext img{margin:15px 0 0}.new{position:absolute;width:26px;height:26px;background:url(../images/ui/icon_new_26x26.png?cdn_id=i72) no-repeat 0 0;margin-left:8px}.new2{position:absolute;width:46px;height:46px;background:url(../images/ui/icon_new_46x46.png?cdn_id=i72) no-repeat 0 0;margin-left:8px}.original-date{text-align:right;font-style:italic}.WidgetEnabled{background-color:#555!important}@media only screen and (max-width:480px){h1{font-size:22px!important;line-height:25px!important}.learn-nav{display:none}.hero{width:auto;height:100%;padding:20px;overflow:hidden;margin-bottom:45px}.learn .hero .hero-leftcontent p:last-of-type{margin-bottom:0}.hero-small,.hero-small-2{display:none}.hero-leftcontent{width:100%}.hero-rightimage{display:none}.col-right .common-post img{margin-bottom:5px}.home .header-wrap{border-bottom-width:0;background:none!important}.home .hero{display:block;height:100px;margin:0;padding:0}.home.content{padding:0}.home h1{display:none}.nav-user.logged-in .username{position:absolute;padding-left:20px;white-space:nowrap;top:254px;background:#3e5480;width:290px;z-index:3;line-height:40px;left:40px;font-size:18px;color:#efeff0;box-shadow:-1px 10px 10px rgba(0,0,0,.6);margin-bottom:-5px;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}.nav-user.logged-in .username:hover{text-decoration:none}.nav-user.logged-in .username:before{content:"Signed in as ";color:#7f90b1}.nav-user.logged-in .hover .username{left:-296px}.home .leftside,.home .rightside{float:none;width:auto;margin:0 5px}.home .rightside{margin-top:30px}.home .common-list-horz.list-one{margin:15px 0}.home .common-list-horz.list-two{margin:15px 0}.home .common-list-horz.list-two li a{display:block}.home .common-list-horz.list-two li{line-height:normal}.home .common-list-horz.list-one li span,.home .common-list-horz.list-two li span{font-size:16px;margin:15px 15px 0 0}.home .common-list-horz.list-two li .icon{top:0}.home .common-list-horz.list-one li div{display:block;line-height:15px;margin-bottom:10px;margin-top:-10px}.home .common-list-horz.list-one li div a{font-size:14px;line-height:20px}.home .common-list-horz.list-one li div span.pipe{font-size:14px}.home .common-list-horz.list-two{margin-bottom:30px;border-top:none;padding-top:5px}.common-list-horz{width:auto}.common-list-horz.list-one li{line-height:22px}.common-list-horz.list-one li.announcement{padding-left:15px;vertical-align:top}.common-list-horz.list-two li.announcement{padding:0 0 10px 15px}.common-list-horz li.icon-announce,.common-list-horz li.icon-rss-lrg{display:none}.common-list-horz li.icon-whatsnew-lrg{display:none}.common-list-horz li.icon-spotlight-lrg{display:none}.common-list-horz li.icon-announcements-lrg{display:none}.home .common-list-horz.list-two li span{margin:0 36px 0 0}.home .common-list-horz.list-two li.announcement>a{top:5px}.common-post{padding:0 5px;width:auto;border-bottom:1px solid #d2d2d2}.home .common-post .excerpt{border-bottom-width:0}.get-started .hero,.learn .hero{width:auto;height:100%;padding:20px;overflow:hidden;margin-top:0}.get-started .hero>p{width:100%}.get-started .content-mod div{width:100%}.get-started .col-left{float:none;width:100%;border:0;padding:0}.get-started .content-mod div.float-right,.get-started .content-mod div.float-left{float:none;margin-bottom:20px}.get-started .customer-mod-list{width:100%;height:auto}.get-started .customer-mod-list li{width:50%}.get-started .customer-mod:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.get-started .case-studies-mod{margin-top:30px}.learn .col-main{border:0;padding:0}.learn .col-center{border:0}.important-heading{margin:0;padding:10px}.common-list-steps.no-bullets li{margin:0;padding:20px 0 0!important}.community .col-left{width:100%;border:0;padding:0}.community .common-post h2,.community .common-post p,.common-sidebar-module .common-list.topmovers li p{margin-left:80px}.community .leftside,.community .rightside{float:none;width:100%}.community .leftside .common-post,.community .rightside .common-post{height:auto}.common-tabs{position:absolute;z-index:0;background:transparent;top:70px;left:0;margin:0;padding:0 5px;width:100%}.common-tabs li{position:absolute;left:0;width:100%;margin:0;background:transparent;padding:0 5px}.common-tabs li a,.common-tabs li a.selected{box-shadow:none;border:1px solid #000;border-radius:0;text-align:left;line-height:20px;padding:5px 10px}.common-tabs{border-radius:0}.common-tabs .selected{z-index:3}.col-top .ad-300x250{position:relative;margin:0 auto 20px;display:none}.common-checklist li{margin-bottom:15px!important}.col-top{padding:0}.col-main{width:100%!important;padding:0}.col-center{padding:0!important;width:100%!important;border-right-width:0!important;margin:0!important}.module-chapters{width:100%!important}.content.article-page.article-content h1{margin-bottom:0}.article-title.keyline{margin-bottom:0;border-bottom:0;width:100%}.content.article-page.article-content .common-tabs{top:115px}.content.article-page.article-content ol img{width:100%}.important.important-box-article p,.important.important-box-article ul,.important.important-box-article strong,.important.important-box-article code{color:#49545d;font-size:14px}.important.important-box-article ul{margin-left:40px}.content.article-page.article-content .col-left h2{color:#4e4e4e;font-weight:normal;font-size:18px}.content.article-page.article-content ol{margin:0;list-style-position:inside;font-size:14px}.content.article-page.article-content ol li p{color:#4e4e4e}.content.article-page.article-content ol pre{margin:0 0 20px 0!important;white-space:pre-wrap;border-style:solid}.sidebar{width:100%}.content.article-page.article-content ul{list-style-type:none;margin:0}.article-content img{width:auto;height:auto;max-width:100%}.author-box.article{border-top:1px solid #d2d2d2;padding:10px 0;border-bottom:1px solid #d2d2d2}.author-box img{margin:0;width:59px;height:59px}.author-box p{margin-left:80px;color:#4e4e4e;font-size:14px;margin-bottom:0}.article-title.keyline h1+.details{margin-bottom:20px}.article-comments.module-comment{border-top-width:0}.article-comments.module-comment .icon-rss-head{display:none}.module-comment .col-left{width:auto}.leave-comment.module-comment .col-right{margin-top:0!important}.common-sidebar-module{clear:both}#comments-toggle{display:block;clear:both;float:left;width:100%;background:transparent;margin-top:20px}#comments-toggle a{display:block;clear:both;float:left;width:100%;text-transform:uppercase;background:#e8ecee;padding:10px 20px;color:#868e95;font-size:14px;text-decoration:none}.post-thumb.generic,.post-thumb{display:none}.common-post-vid h3,.common-post-vid p{float:left;margin-left:0!important}.common-post-vid p{float:left;margin-left:10px!important}.module-intro .post-thumb{display:block}.module-comment-header{border-bottom-width:0}p.breadcrumbs{font-size:14px;color:#474747}#comment-list li:first-child{border-top:0}#comment-list li a:first-child img{margin:0;width:30px;height:30px}#comment-list li p{margin-left:40px!important;color:#737d86}#comment-list li:last-child{border-bottom-width:0}.module-vid-player{width:100%;height:256px}.module-vid-player img{width:100%;height:100%}.module-vid-player object,.module-vid-player video,.module-vid-player iframe{width:100%!important;height:226px!important}.download-box-article{margin-top:20px;position:relative;border:1px solid #d2d2d2;border-width:1px 0 0;width:100%;background:transparent;text-align:left;padding:0;line-height:54px;margin-bottom:0}.download-box-article .separator{float:left;margin:0;display:none}.download-box-article p:before{content:"Downloads:";font-size:14px;color:#4c5969;text-transform:uppercase;font-weight:normal;color:#4c5969;text-indent:0;position:absolute;top:-40px;left:0;height:100%}.download-box-article p{width:100%;text-indent:-9999px;font-size:0!important}.download-box-article p a{float:left;font-size:14px;font-weight:normal;background:#598527;color:#fff;font-size:16px;width:30%;padding:5px 0;text-align:center;line-height:20px;text-indent:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:5px 10px 5px 0}.download-box-article+h2{margin-top:20px}.download-box-article{width:100%}.download-box-article:after{clear:both;content:‘.‘;display:block;visibility:hidden;height:0}.prettyprint.linenums span{white-space:normal}.note{width:100%}.nav-multi-part{border-top:0;border-bottom:1px solid #d2d2d2}.leave-comment{border-top:0}.leave-comment p,.leave-comment h2{text-align:left;color:#4e4e4e}.leave-comment .col-left h2{margin-bottom:10px}#comment-body{width:100%}.module-comment input[type=button],.module-comment input[type=submit]{margin:0 10px 0 0!important}.leave-feedback{width:auto;float:left;margin-left:120px;margin-top:-40px}.article-comments{padding-top:0}.module-chapters{display:none}p.video_thumb{padding-right:120px}.video-thumb-single{height:auto;background:none;position:absolute;bottom:0}.video-thumb-single .play_button{border:0;background:#809aaf;color:#fff;text-align:center;width:120px;height:auto;padding:10px;left:-120px}.video-thumb-single img{display:none}.video-thumb-single .play_button:after{content:"Watch Video";text-transform:uppercase;font-size:14px}.converted{display:none}.common-tabs{display:none}.curricula-list-sidebar ol{display:none}.search-facet{width:100%;padding:0}.content.search h1{font-size:18px}.keyline-title{border:0}.search-filter{background:transparent;border:0}.search-filter h2,.search-filter h3,.search-filter .search-box label{display:none}.search-filter .search-box{position:relative}.search-filter .search-box p.search-fields,.search-filter .search-box input[type=text]{background:#f6f6f6;width:100%;padding:0 10px;line-height:20px;border:0}.search-filter .search-box p.search-fields{border:1px solid #d2d2d2;overflow:hidden;margin-bottom:20px}.search-filter .search-box .input-search-submit{position:absolute;right:0;top:0}.search .col-right{width:100%}.pagination{width:100%}#search-order-select{margin-bottom:20px}.search-results{margin:0}.pagination .prev{background:url(../images/ui/pager-arrows.png?cdn_id=i72) 0 0 no-repeat;width:10px!important;height:15px!important;text-indent:-9999px;border:0;margin:6px 5px 0}.pagination .next{background:url(../images/ui/pager-arrows.png?cdn_id=i72) -10px 0 no-repeat;width:10px!important;height:15px!important;text-indent:-9999px;border:0;margin:6px 5px 0}.pagination a{line-height:25px;padding-top:0}.pagination .nolink{line-height:20px;padding-top:0}.pagination a,.pagination span.nolink,.pagination .disabled{width:26px}.nolink+a{display:block!important}.pagination>:last-child{display:block!important}.downloads .doublelists{float:none;width:100%}.pluralsight.content .calltoaction{position:none;height:100%}.pluralsight.content .calltoaction a.btn-install.second{position:relative;left:0}.pluralsight.content .calltoaction a.btn-install{position:relative;left:0;margin-bottom:15px}.pluralsight ul.two-column-list li{float:none}.pluralsight.content .calltoaction p{font-size:16px}.archives .head-desc{width:inherit}.archives .search-results{padding:0}.archives .col-left{padding:0;width:100%;border:0}.archives .pagination{margin:0 0 10px 0}.two-col .col-left{width:100%;padding:0;border:0}.mini-nav{display:block}.ad-300x250{margin:15px auto 35px}.ad-300x250 a{display:block}.ad-300x250 img{display:block;margin:0 auto}.ad-728x90{visibility:hidden;margin:0;height:0;display:none}.ad-728x90.ad{display:none!important}.ad-home{display:none!important}.module-community{width:100%}.fl-menu{display:none}.common-post{padding:0 5px 20px}.promo-box-wrapper li h2 a{min-height:152px}.article-content table td,.article-content table th{padding:0;margin:0;width:0}.downloads h1{width:auto}.hosted .col-left .subhero .subherohero{display:none}.hosted.two-col .col-left,.hosted.two-col .col-right{width:100%;height:100%;padding-right:0}.hosted .col-left .subhero,.hosted .col-right .subhero{width:100%;padding:20px;height:100%}.hosted .col-left .subhero h3,.hosted .col-right .subhero h3{font-size:22px;line-height:22px}.hosted .col-left .subhero p,.hosted .col-right .subhero p{font-size:18px;line-height:20px}.hosted .subhero a.btn-azure.white{line-height:20px}.col-right-learn{width:100%;padding:0;float:none;border:0;margin-left:-1px}.col-right-learn .social-bar{margin:22px 0}.details .social-bar{position:static!important;margin:22px 0!important}article header{height:auto;margin:0;padding:0}.icon-list,.icon2-list{width:100%}.icon-list,.icon2-list{float:none}.icon-list li a,.icon2-list li p{width:75%;height:auto}.icon2-list{margin-top:30px}.module-form-wrapper{width:100%}.form-wrapper textarea.txt_area{width:230px}.content.contact-us{padding-bottom:0}.hof .col-left{width:100%;border:0;padding:0}.tbl-recognition{width:auto}.sort-box .module-common-select{position:static}.mobile .hero-leftcontent{width:100%;margin:0}.search .sortingoptions{width:100%}.search-results .resultnumber{left:-25px}.tags{width:100%}div.hero.fourwide{height:auto}.ajax .icon-rss-head .icon{margin-left:0}.pluralsight.content .col-full{padding:0}.samples .col-left{width:100%;border:0;padding:0;margin:0}.samples .content-wrap{padding:0;margin-top:15px}.two-col h3:first-child{margin-top:0}ul.entity-content li a{margin-right:10px;min-height:70px}.new,.new2{display:none}}.modal{background:none repeat scroll 0 0 #fff;border:1px solid #666;box-shadow:0 0 1em #666;left:50%;position:fixed;top:40%;z-index:1000}.modal a.modal-close{position:absolute;right:15px;top:15px;color:#3babd0;font-size:20px}.modal a.modal-close:hover{text-decoration:none;color:#000}.modal .modal-header{min-height:90px}.modal .modal-contents{padding:15px 15px 0}.modal h2{font-size:1em;font-weight:bold;color:#000;line-height:1.4em}.modal-cover{background:none repeat scroll 0 0 #fff;height:100%;top:0;opacity:.6;position:fixed;width:100%;z-index:20}@media only screen and (max-width:480px){.modal{visibility:hidden}}.modal-webpi{width:700px;margin-left:-350px;margin-top:-108px}.modal-webpi p{height:150px;border:1px solid #e1e2e2;margin:15px 0;padding:15px;font-size:15px;line-height:1.4em}.modal-webpi .btn-install{float:right}.pln{color:#000}@media screen{.str{color:#a31515}.kwd{color:#00f}.com{color:green}.typ{color:#2b91af}.lit{color:red}.pun,.opn,.clo{color:#000}.tag{color:#a31515}.atn{color:red}.atv{color:#00f}.dec{color:purple}.var{color:#000}.fun{color:#000}}@media print,projection{.str{}.kwd{font-weight:bold}.com{font-style:italic}.typ{font-weight:bold}.lit{}.pun,.opn,.clo{}.tag{font-weight:bold}.atn{}.atv{}}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}pre,.code_block{padding:5px;margin:18px 0 30px;border:1px dashed #ccc;font-family:"Consolas",monospace;overflow:auto;display:block;white-space:pre;background-color:#f3f3f3}code{font-family:"Consolas",monospace;color:#800039}pre.lang-command-line{color:#000!important}pre.lang-command-line span{color:#000!important}pre.lang-terminal{background-color:#000;color:#fff!important}pre.lang-terminal span{color:#fff!important}.social-bar{text-align:right;margin:22px 0;height:20px;overflow:hidden}.details .social-bar{margin:0;position:absolute;right:52px;bottom:5px}.social-item{display:inline-block;margin-left:10px;vertical-align:top;height:20px;overflow:hidden;width:98px}.print-bar{position:absolute;right:0;bottom:7px}.print-bar a{background:#969696;color:#fff;padding:0 11px 3px}.print-bar a:hover{background:#d2d2d2;text-decoration:none}.notes{background:#efefef;padding:25px;margin:15px 0}.notes span{background:url(../images/ui/sprite-notes.png?cdn_id=i72) 0 0 no-repeat;display:block;width:28px;height:31px;position:absolute;margin-left:-59px}.notes-important span{background-position:-75px 0}.notes-caution span{background-position:0 0}.notes-warning span{background-position:-37px 0}.notes-tip span{background-position:-107px 0}.notes-basic span{background-position:-170px 0}.notes-security span{background-position:-136px 0}.notes-important{border-left:40px solid #ffb900}.notes-caution{border-left:40px solid #ff8c00}.notes-warning{border-left:40px solid #e81123}.notes-tip{border-left:40px solid #00bcf2}.notes-basic{border-left:40px solid #7fba00}.notes-security{border-left:40px solid gray}.print-only,.print-only-inline{display:none}@media print{.print-no{display:none}.print-only{display:block}.print-only-inline{display:inline}header{display:none}.footer{margin-top:0;width:auto;padding:10px}.footer-menu{margin:0}.footer-menu li{display:none}.footer-menu li.block{display:block}.footer-menu.last{display:none}.allcontent{min-width:inherit}.content{width:auto;padding:0;margin:10px}.learn-nav{display:none}.module-chapters{display:none}.download-box-article{text-align:left}.col-right-learn{width:auto;padding:0;float:none;border:0}.col-right-learn a:link,.col-right-learn a:visited{font-weight:bold}.col-right-learn a:link:after{content:" (" attr(href) ") ";font-size:90%}.article-content img{max-width:100%}.article-title .details .author-header{width:100%}.video-thumb-single{display:none}.print-bar{display:none}.social-bar{display:none}.nav-multi-part{display:none}.leave-comment{display:none}.comments-status{display:none}#comments-toggle{display:none}.note .dogear,.sidebar .dogear{display:none}.ad-728x90{display:none}pre{white-space:pre-wrap}.hero{width:auto}.hero .btn-install{display:none}.two-col a:link,.two-col a:visited{font-weight:bold}.two-col a:link:after{content:" (" attr(href) ") ";font-size:90%}.hero-rightimage{display:none}.hero-leftcontent{width:auto}.two-col .important .btn-install{display:none}.two-col .col-left{width:100%;border:0;padding:0}.two-col .col-right{display:none}.two-col div.divider{width:100%;left:0}}.select-convert,.mini-nav,.new-inbox{display:none}@media only screen and (max-width:480px){*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.new-inbox{display:none!important}.allcontent{min-width:0;max-width:480px;width:100%}.content{width:100%;padding:0 5px;margin:0;position:relative}.nav-user.logged-in{display:block;background:none;height:50px;width:44px;top:0}.nav-user.logged-in>ul{padding-top:0;margin:0;position:absolute;top:0;left:0;height:50px;width:44px}.nav-user.logged-in img.avatar{display:none}.nav-user.logged-in>ul>li{margin-left:50px;display:block!important;position:absolute;left:0;top:0;height:50px;width:38px}.nav-user.logged-in .username+p{position:absolute;padding-left:20px;top:290px;background:#3e5480;width:290px;z-index:3;line-height:40px;left:40px;font-size:18px;color:#efeff0;box-shadow:-1px 10px 10px rgba(0,0,0,.6);margin-bottom:-5px;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}.nav-user.logged-in .hover .username+p{left:-296px}.nav-user.logged-in .common-dropdown.hover li.drop-head{display:none}.new-notifications{background:#f7e3e4!important}.nav-user.logged-in .common-dropdown{clear:both;height:24px;width:24px;z-index:2;display:block;border:none;padding:0}.nav-user.logged-in .common-dropdown li:first-child{margin-top:24px}.nav-user.logged-in .common-dropdown li,.nav-user.logged-in .common-dropdown li.last-child{margin-top:-4px;display:block;margin-left:22px;float:none;margin-left:85px;background:#efeff0;width:290px;border-top:1px solid #fff;box-shadow:-1px 10px 10px rgba(0,0,0,.6);margin-bottom:-5px;z-index:2;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}.nav-user.logged-in .common-dropdown.hover li{display:block;margin-left:-248px}.nav-user.logged-in .common-dropdown.hover:before,.nav-user.logged-out.hover:before{content:"";width:620px;height:9000px;position:absolute;top:49px;left:-540px;background:rgba(0,0,0,.6);z-index:-1}.nav-user.logged-in .common-dropdown li>a{color:#267cb2;font-weight:normal;display:block;padding:13px 18px 17px 18px;font-size:14px}.nav-user.logged-in .common-dropdown li>a.selected{color:#267cb2!important;background:none;box-shadow:none}.nav-user.logged-out{position:absolute;top:0;right:0;display:block;clear:both;padding:0;margin:0;height:36px;width:36px;background:transparent url(../images/ui/asp-net-icon-cog-b.png?cdn_id=i72) 0 0 no-repeat;background-size:100% 100%;z-index:2;top:8px;right:8px;border:10px solid transparent;border-radius:8px;padding:9px 10px 9px 11px;display:block;left:auto}.nav-user.logged-out p{position:absolute}.nav-user.logged-out.hover p{position:absolute;display:block;right:0;top:38px;width:200px}.nav-user.logged-out p a{margin-top:-4px;display:block;float:none;margin-left:235px;background:#efeff0;width:290px;border-top:1px solid #fff;box-shadow:-1px 10px 10px rgba(0,0,0,.6);margin-bottom:-5px;z-index:2;font-weight:normal;padding:12px 18px 16px 18px;font-size:14px;color:#267cb2;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}.nav-user.logged-out.hover p a{margin-left:85px}.nav-user.logged-out p span{display:none}#messages{display:none!important;position:absolute;top:0;left:0!important;display:block;height:100%;width:40px;line-height:40px}body{max-width:480px;min-width:0}header{min-width:0;height:65px;max-width:480px;padding-top:10px;background:transparent;width:100%;min-height:65px;margin-top:0}header a#logo{position:static;display:block;margin-left:0;width:79px;height:48px;margin-bottom:5px;background-image:url(‘../images/ui/asp-net-logo-c.png?cdn_id=i72‘);background-size:100% 100%}div.search-header{margin:0;background:transparent;position:absolute;width:18px;height:18px;top:17px;right:140px;left:auto;border-width:0}div.search-header input{display:none}div.search-header input[type=text],nav,.language-translation a.language,.nav-user.logged-out,.nav-user.logged-in .common-dropdown.hover,.nav-user.logged-in .common-dropdown,.nav-user.logged-out.hover,nav .active{background:transparent url(../images/ui/asp-net-mobile-icon-sprite.png?cdn_id=i72) 0 0 no-repeat;height:48px;width:48px}div.search-header input[type=text]{background-size:95px 47px;display:block;width:24px;height:24px;border:0;position:absolute;top:0;left:0;padding:0;margin:0;text-indent:-9999px;line-height:0}div.search-header input[type=text]:focus{width:150px;text-indent:0;left:auto;color:#343434;background:#fff;padding:7px 10px;font-size:14px;top:-7px;right:0;height:32px;box-shadow:inset 0 0 2px rgba(0,0,0,.7);border-radius:3px;-moz-transition:width ease-out .2s;-ms-transition:width ease-out .2s;-o-transition:width ease-out .2s;-webkit-transition:width ease-out .2s;transition:width ease-out .2s;border:1px solid #ccc}.language-translation{position:absolute;top:0;right:0}.language-translation a.language{background-position:-24px 0;color:#fff;font-size:0;height:24px;width:24px;display:block;padding:0;position:absolute;right:97px;left:auto;top:16px;-webkit-background-size:95px 47px;-moz-background-size:95px 47px;-o-background-size:95px 47px;background-size:95px 47px}.language-translation a.language.active{background-position:-24px -24px}.language-translation .translator{width:245px;z-index:1}.common-dropdown{position:absolute;right:60px;top:50px}.language-translation .common-dropdown{position:absolute;left:-245px;top:65px;padding-bottom:10px}.language-translation a.active:before{content:"";width:1020px;height:9000px;position:absolute;top:49px;left:-470px;background:rgba(0,0,0,.6);z-index:-1}nav{background-size:95px 47px;clear:both;padding:0;margin:0;height:24px;width:24px;background-position:-48px 0;position:absolute;z-index:1;top:16px;right:60px}nav.active{background-position:-48px -24px}.nav-user.logged-in .common-dropdown.hover+.new-inbox{display:none}.nav-user.logged-in .common-dropdown.hover li.second-child{margin-top:49px}.nav-user.logged-in .common-dropdown.hover{background-size:95px 47px;background-position:-72px -24px}.nav-user.logged-out.hover{width:24px;background-size:95px 47px;background-position:-72px -24px}.nav-user.logged-in .common-dropdown{height:24px;background-size:95px 47px;background-position:-72px 0}.new-inbox{display:block;position:absolute;background-color:#fc5558;height:50px;margin-left:-50px;width:44px;top:0;left:0;text-align:center;line-height:50px;font-size:18px;color:#fff;z-index:3}.nav-user.logged-in .common-dropdown.notifications .mini-nav:first-child a{color:#f46e70;text-decoration:none}.nav-user.logged-out{background-size:95px 47px;background-position:-72px 0;border:0;height:24px;width:24px;border-radius:0;padding:0;right:18px;top:16px}nav.nav-main>ul li,nav.nav-main>ul li.last-child{margin-top:0}nav.nav-main>ul li,nav.nav-main ul li.last-child,.nav-main-solutions p a{display:block;margin-left:22px;float:none;margin-left:85px;background:#efeff0;width:200px;border-top:1px solid #fff;box-shadow:-1px 10px 10px rgba(0,0,0,.6);margin-bottom:-5px;z-index:2;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}nav.nav-main>ul>li:first-child{margin-top:48px;margin-left:85px}nav.nav-main>ul.hover>li{display:block;margin-left:-110px}nav.nav-main>ul>li{display:none}nav.nav-main ul.hover:before{content:"";width:520px;height:9000px;position:absolute;top:49px;left:-400px;background:rgba(0,0,0,.6);z-index:-1}nav.nav-main ul li>a,.nav-main-solutions .col ul li a,.nav-main-solutions p a{color:#267cb2;font-weight:normal;display:block;padding:13px 18px 17px 18px;font-size:14px}nav.nav-main ul li>a.selected{color:#267cb2!important;background-color:#ccc;box-shadow:none}nav.nav-main ul li>a:hover{text-decoration:underline}.nav-user.logged-in>ul>li{width:60px}.nav-main-solutions .col ul{float:none;margin-left:0;display:block;width:100%;padding-bottom:0}.nav-main-solutions{position:static!important;z-index:auto}.dropdown-learn a,.dropdown-community a{position:relative;display:block!important;padding:13px 18px 17px!important}.dropdown-learn,.dropdown-community{display:none!important;z-index:3;position:absolute;top:36px;left:-130px;padding:0;-moz-transition:all ease-out .2s;-ms-transition:all ease-out .2s;-o-transition:all ease-out .2s;-webkit-transition:all ease-out .2s;transition:all ease-out .2s}.dropdown-learn:hover,.dropdown-community:hover{display:none!important}nav.nav-main ul.solutions-expanded.communitypulldown .dropdown-community{display:block!important}nav.nav-main ul.solutions-expanded.learnpulldown .dropdown-learn{display:block!important}nav.nav-main ul.solutions-expanded .dropdown-learn:before,nav.nav-main ul.solutions-expanded .dropdown-community:before{content:"";width:1020px;position:absolute;top:8px;left:-470px;background:rgba(0,0,0,.6);z-index:-1}nav.nav-main ul.solutions-expanded li{margin-left:-230px}nav li a.selected .icon-dropdown,nav li:hover a.selected .icon-dropdown{background-position:-10px 0}.nav-main-solutions .col{display:block;float:none;position:static;margin:0;width:100%;padding:0}.nav-main-solutions .col h2,.nav-main-solutions p span{display:block;border-bottom:0;margin:0;background:#d3d3d4;font-size:14px;color:#80808a;width:100%;padding:10px 0 10px 20px;margin-top:-5px;box-shadow:-1px 10px 10px rgba(0,0,0,.6)}*{-webkit-text-size-adjust:100%}.nav-main-solutions .col h2{margin:0}nav.nav-main ul.solutions-expanded .nav-main-solutions .col ul li{margin-left:0;width:100%}nav.nav-main ul.solutions-expanded .nav-main-solutions .col ul li hr{display:none}.nav-main-solutions p{margin:0;padding:0;font-size:0}.nav-main-solutions p a{margin:0;width:100%;margin-top:-20px}.nav-main-solutions p span+a{margin-top:0}.nav-main-solutions>a{position:relative}nav ul .icon-dropdown,nav ul a:hover .icon-dropdown{right:30px;top:12px;width:10px;height:15px;background:url(../images/ui/pager-arrows.png?cdn_id=i72) -10px 0 no-repeat;padding:0;margin:0}.nav-user{display:none;right:0}.header{min-height:50px}.select-convert{display:block;width:100%;margin-bottom:20px}.col-center{width:100%!important;max-width:480px;padding:0!important;margin-left:0;margin-right:0;border:0}.col-right{width:100%!important;padding:0!important;margin:30px 0 0 0!important}.footer{width:100%;padding:0 0 11px 0}.footer-menu h2,.footer-menu li h2 a{font-size:13px;color:#989797;margin-bottom:10px;line-height:1.4em}.footer-menu li{line-height:1em}.footer-menu li a{font-size:10px}ul.footer-menu{margin-bottom:10px;width:100%}ul.footer-menu+ul.footer-menu{width:auto;margin:10px 0 0;float:left;padding-right:0;max-width:100%}ul.footer-menu+ul.footer-menu li:first-child~li{float:left}ul.footer-menu.last li:first-child~li{margin:-3px 0 0 0}ul.footer-menu{padding:0 5px}ul.footer-menu.last{float:left;position:relative;max-width:205px;margin:0;padding-left:5px}.footer-menu .separator{padding:0 2px}.footer .logo-microsoft{width:88px}div.social{display:none}}
-->

时间: 2024-10-11 11:15:29

EntityFramework_MVC4中EF5 新手入门教程之一 ---1.创建实体框架数据模型的相关文章

EntityFramework_MVC4中EF5 新手入门教程之四 ---4.在EF中创建更复杂的数据模型

在以前的教程你曾与一个简单的数据模型,由三个实体组成.在本教程中,您将添加更多的实体和关系,并通过指定格式. 验证和数据库映射规则,您将自定义数据模型.你会看到自定义的数据模型的两种方式: 通过添加属性,实体类并通过将代码添加到数据库上下文类. 当您完成时,实体类将已完成的数据模型中,如下图所示: 通过使用属性进行自定义的数据模型 在本节中,您会看到如何通过使用指定的格式,验证和数据库映射规则的属性来自定义数据模型.然后在以下各节,您将创建的几个完整的School数据模型,通过添加属性的类已创建

EntityFramework_MVC4中EF5 新手入门教程之七 ---7.通过 Entity Framework 处理并发

在以前的两个教程你对关联数据进行了操作.本教程展示如何处理并发性.您将创建工作与各Department实体的 web 页和页,编辑和删除Department实体将处理并发错误.下面的插图显示索引和删除的页面,包括一些如果发生并发冲突,则显示的消息. 并发冲突 当一个用户要编辑它,显示实体数据,然后另一个用户更新相同的实体数据第一个用户的更改写入到数据库之前,将发生并发冲突.如果您不启用此类冲突检测,最后谁更新数据库覆盖其他用户的更改.在许多应用中,这种风险是可以接受: 如果有几个用户或一些更新,

EntityFramework_MVC4中EF5 新手入门教程之六 ---6.通过 Entity Framework 更新关联数据

在前面的教程中,您将显示相关的数据 :在本教程中,您会更新相关的数据.对于大多数的关系,这个目标是可以通过更新相应的外键字段来达到的.对于多对多关系,实体框架并不直接,暴露联接表,因此您必须显式添加和删除,并从相应的导航属性的实体. 下面的插图显示页面,您将利用工作. 为课程自定义创建和编辑页面 当创建新的课程实体时,它必须拥有一个关系到现行的部门.为了推动这项工作,搭建的代码包括控制器方法,并且创建和编辑视图中包括用于选择处的下拉列表.下拉列表中设置Course.DepartmentID的外键

EntityFramework_MVC4中EF5 新手入门教程之五 ---5.通过 Entity Framework 读取相关数据

在前面的教程中,您完成School数据模型.在本教程中,您会读取和显示相关的数据 — — 那就是,实体框架将加载到导航属性的数据. 下面的插图显示页面,您将完成的工作. 延迟. 预先,和显式加载的相关数据 有实体框架可以将相关的数据加载到一个实体的导航属性的几种方法: 延迟加载.当第一次读的实体时,并不被检索相关的数据.然而,第一次尝试访问导航属性,该导航属性所需的数据是自动检索.这将导致多个查询发送到数据库 — — 一个用于该实体本身,一个必须检索每个相关的实体的数据的时间. 预先加载.当读取

EntityFramework_MVC4中EF5 新手入门教程之二 ---2.执行基本的 CRUD 功能

在前面的教程中,您创建 MVC 应用程序中,存储和显示数据使用实体框架和 SQL 服务器 LocalDB.在本教程中,您会审查和自定义的 CRUD (创建. 读取. 更新. 删除) MVC 脚手架会自动为您在控制器和视图中创建的代码. 注它是常见的做法,实施资源库模式,以创建您的控制器和数据访问层之间的一个抽象层.为了保持这些教程简单,不会直到后来在这个系列教程执行一个存储库. 在本教程中,您将创建以下 web 页: 创建详细信息页 学生Index 页的搭建的代码排除在外的Enrollments

EntityFramework_MVC4中EF5 新手入门教程之三 ---3.排序、 筛选和分页

在前面的教程你实施了一套基本的 CRUD 操作,为Student实体的 web 页.在本教程中,您将添加排序. 筛选和分页到 StudentsIndex的功能.您还将创建一个页面,并简单分组. 下面的插图显示页面当你完成时的样子.列标题是链接,用户可以单击要作为排序依据的列.单击列标题,一再升序和降序之间切换. 将列排序链接添加到学生索引页 若要添加排序到学生索引页,会改变Student控制器的Index方法,将代码添加到Student的索引视图. 添加排序功能指数法 在Controllers\

【LaTeX】E喵的LaTeX新手入门教程(2)基础排版

换了块硬盘折腾了好久..联想的驱动真坑爹.前情回顾[LaTeX]E喵的LaTeX新手入门教程(1)准备篇文档框架嗯昨天我们已经编写了一个最基本的文档,其内容是这样的:\documentclass{article}\begin{document}XXX is a SB.\end{document}这个文档呢其实是分为两部分的:一部分是\begin{document}之前的那部分也就是第一行,这一部分我们称之为导言区.导言区的内容可以不只一行,它的作用是完成文档的基础设定.比如在这个文档中,我们使用

【LaTeX】E喵的LaTeX新手入门教程(5)参考文献、文档组织

这不是最后一篇,明天开始建模所以会从6号开始继续更新.前情回顾[LaTeX]E喵的LaTeX新手入门教程(1)准备篇 [LaTeX]E喵的LaTeX新手入门教程(2)基础排版 [LaTeX]E喵的LaTeX新手入门教程(3)数学公式 [LaTeX]E喵的LaTeX新手入门教程(4)图表参考文献天下文章一大抄,抄来抄去有提高. ——白岩松常备工具:JabRef>>戳我下载<<JabRef是一款管理参考文献用的软件,相当好用.装好了以后在选项中把这两个选项改成如图示的样子.*nix用户

【LaTeX】E喵的LaTeX新手入门教程(3)数学公式

昨天熄灯了真是坑爹.前情回顾[LaTeX]E喵的LaTeX新手入门教程(1)准备篇 [LaTeX]E喵的LaTeX新手入门教程(2)基础排版上一期测试答案1.大家一开始想到的肯定是\LaTeX{}er.其实\LaTeX er也可以的.2.\LaTeX{} er或\LaTeX\ er数学模式现在我们打算在文档中插入一些数学公式什么的了:按照正常的情况来说,数学公式里面的字符一般都是斜体,而我们要用\textit来一点点把需要变的文字变成斜体这显然是一件极其坑爹的事情.TeX的创造者高爷爷表示他搞T