This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace EntityFrameworkExtraMile.Web.Migrations | |
{ | |
using System.Data.Entity.Migrations; | |
public partial class InitializeEtc : DbMigration | |
{ | |
public override void Up() | |
{ | |
CreateIndex("Category", "Name", true); | |
CreateIndex("JobTitle", "Title", true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
migrate.exe ProjectNameContainingContext /startUpConfigurationFile:..\web.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [HumanResources] | |
GO | |
/****** Object: Table [dbo].[Dependent] Script Date: 11/14/2013 4:39:17 PM ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[Dependent]( | |
[ID] [int] IDENTITY(1,1) NOT NULL, | |
[EmployeeID] [int] NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template hostspecific="true" language="C#" #> | |
<#@ include file="EF.Utility.CS.ttinclude" #><#@ | |
output extension=".cs" #><# | |
var efHost = (EfTextTemplateHost)Host; | |
var code = new CodeGenerationTools(this); | |
#> | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using <#= code.EscapeNamespace(efHost.MappingNamespace) #>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template hostspecific="true" language="C#" #> | |
<#@ include file="EF.Utility.CS.ttinclude" #><#@ | |
output extension=".cs" #><# | |
var efHost = (EfTextTemplateHost)Host; | |
var code = new CodeGenerationTools(this); | |
#> | |
using System.Data.Entity; | |
using <#= code.EscapeNamespace(efHost.MappingNamespace) #>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template hostspecific="true" language="C#" #> | |
<#@ include file="EF.Utility.CS.ttinclude" #><#@ | |
output extension=".cs" #><# | |
var efHost = (EfTextTemplateHost)Host; | |
var code = new CodeGenerationTools(this); | |
#> | |
using System; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
// Simplifying assumptions based on reverse engineer rules | |
// - No complex types | |
// - One entity container | |
// - No inheritance | |
// - Always have two navigation properties | |
// - All associations expose FKs (except many:many) | |
#> | |
<#@ template hostspecific="true" language="C#" #> | |
<#@ include file="EF.Utility.CS.ttinclude" #><#@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEnumerable<string> GetItems() | |
{ | |
var result = new List<string>(); | |
result.Add("Test1"); | |
result.Add("Test2"); | |
result.Add("Test3"); | |
return result; | |
} |