Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(example): pluralize todo Items collection
  • Loading branch information
jaredcnance committed Mar 15, 2017
commit 624d0c2ae8b01367b6d699a15f08c2fd0c57d490
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCoreExample/Data/AppDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public AppDbContext(DbContextOptions<AppDbContext> options)

public DbSet<TodoItem> TodoItems { get; set; }
public DbSet<Person> People { get; set; }
public DbSet<TodoItemCollection> TodoItemCollection { get; set; }
public DbSet<TodoItemCollection> TodoItemCollections { get; set; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
});

migrationBuilder.CreateTable(
name: "TodoItemCollection",
name: "TodoItemCollections",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Expand All @@ -33,9 +33,9 @@ protected override void Up(MigrationBuilder migrationBuilder)
},
constraints: table =>
{
table.PrimaryKey("PK_TodoItemCollection", x => x.Id);
table.PrimaryKey("PK_TodoItemCollections", x => x.Id);
table.ForeignKey(
name: "FK_TodoItemCollection_People_OwnerId",
name: "FK_TodoItemCollections_People_OwnerId",
column: x => x.OwnerId,
principalTable: "People",
principalColumn: "Id",
Expand All @@ -57,9 +57,9 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
table.PrimaryKey("PK_TodoItems", x => x.Id);
table.ForeignKey(
name: "FK_TodoItems_TodoItemCollection_CollectionId",
name: "FK_TodoItems_TodoItemCollections_CollectionId",
column: x => x.CollectionId,
principalTable: "TodoItemCollection",
principalTable: "TodoItemCollections",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
Expand All @@ -81,8 +81,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "OwnerId");

migrationBuilder.CreateIndex(
name: "IX_TodoItemCollection_OwnerId",
table: "TodoItemCollection",
name: "IX_TodoItemCollections_OwnerId",
table: "TodoItemCollections",
column: "OwnerId");
}

Expand All @@ -92,7 +92,7 @@ protected override void Down(MigrationBuilder migrationBuilder)
name: "TodoItems");

migrationBuilder.DropTable(
name: "TodoItemCollection");
name: "TodoItemCollections");

migrationBuilder.DropTable(
name: "People");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.HasIndex("OwnerId");

b.ToTable("TodoItemCollection");
b.ToTable("TodoItemCollections");
});

modelBuilder.Entity("JsonApiDotNetCoreExample.Models.TodoItem", b =>
Expand Down