diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs index dc2fb4d968..d343943548 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs @@ -4,8 +4,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Metadata.ModelConventions; using Microsoft.Data.Entity.Relational.Migrations; using Microsoft.Data.Entity.Relational.Migrations.Builders; using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; @@ -31,22 +29,15 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests [ContextType(typeof(BloggingContextWithMigrations))] public class BloggingContextWithMigrationsModelSnapshot : ModelSnapshot { - public override IModel Model + public override void BuildModel(ModelBuilder builder) { - get + builder.Entity("Blogging.Models.Blog", b => { - var builder = new ModelBuilder(new ConventionSet()); - - builder.Entity("Blogging.Models.Blog", b => - { - b.Property("BlogId"); - b.Property("BlogId").GenerateValueOnAdd(); - b.Property("Name"); - b.Key("BlogId"); - }); - - return builder.Model; - } + b.Property("BlogId"); + b.Property("BlogId").GenerateValueOnAdd(); + b.Property("Name"); + b.Key("BlogId"); + }); } } @@ -63,9 +54,9 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests get { return CurrentProductVersion; } } - public override IModel Target + public override void BuildTargetModel(ModelBuilder modelBuilder) { - get { return new BloggingContextWithMigrationsModelSnapshot().Model; } + new BloggingContextWithMigrationsModelSnapshot().BuildModel(modelBuilder); } public override void Up(MigrationBuilder migrationBuilder) @@ -98,9 +89,9 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests get { return CurrentProductVersion; } } - public override IModel Target + public override void BuildTargetModel(ModelBuilder modelBuilder) { - get { return new BloggingContextWithMigrationsModelSnapshot().Model; } + new BloggingContextWithMigrationsModelSnapshot().BuildModel(modelBuilder); } public override void Up(MigrationBuilder migrationBuilder) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs index 426c1a63c1..43e189a4ac 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs @@ -4,8 +4,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Metadata.ModelConventions; using Microsoft.Data.Entity.Relational.Migrations; using Microsoft.Data.Entity.Relational.Migrations.Builders; using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; @@ -21,9 +19,8 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests [ContextType(typeof(BloggingContextWithPendingModelChanges))] public class BloggingModelSnapshot : ModelSnapshot { - public override IModel Model + public override void BuildModel(ModelBuilder modelBuilder) { - get { return new ModelBuilder(new ConventionSet()).Model; } } } @@ -40,9 +37,8 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests get { return CurrentProductVersion; } } - public override IModel Target + public override void BuildTargetModel(ModelBuilder modelBuilder) { - get { return new ModelBuilder(new ConventionSet()).Model; } } public override void Up(MigrationBuilder migrationBuilder) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs index 24993e0dca..969725115d 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs @@ -3,12 +3,12 @@ using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; using Microsoft.Data.Entity.Relational.Migrations; using Microsoft.Data.Entity.Relational.Migrations.Builders; using Microsoft.Data.Entity.Relational.Migrations.Infrastructure; using System; + namespace Microsoft.AspNet.Diagnostics.Entity.Tests { public class BloggingContextWithSnapshotThatThrows : BloggingContext @@ -20,12 +20,9 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests [ContextType(typeof(BloggingContextWithSnapshotThatThrows))] public class BloggingContextWithSnapshotThatThrowsModelSnapshot : ModelSnapshot { - public override IModel Model + public override void BuildModel(ModelBuilder modelBuilder) { - get - { - throw new Exception("Welcome to the invalid snapshot!"); - } + throw new Exception("Welcome to the invalid snapshot!"); } } @@ -42,9 +39,9 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests get { return CurrentProductVersion; } } - public override IModel Target + public override void BuildTargetModel(ModelBuilder modelBuilder) { - get { return new BloggingContextWithSnapshotThatThrowsModelSnapshot().Model; } + new BloggingContextWithSnapshotThatThrowsModelSnapshot().BuildModel(modelBuilder); } public override void Up(MigrationBuilder migrationBuilder)