本文整理汇总了C#中ModelBuilder.Annotation方法的典型用法代码示例。如果您正苦于以下问题:C# ModelBuilder.Annotation方法的具体用法?C# ModelBuilder.Annotation怎么用?C# ModelBuilder.Annotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelBuilder
的用法示例。
在下文中一共展示了ModelBuilder.Annotation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildModel
public override void BuildModel(ModelBuilder builder)
{
builder
.Annotation("ProductVersion", "7.0.0-beta6-13815");
builder.Entity("EF7ProjectLemon.Auth", b =>
{
b.Property<int>("AuthId")
.ValueGeneratedOnAdd();
b.Property<string>("Login");
b.Key("AuthId");
});
builder.Entity("EF7ProjectLemon.Person", b =>
{
b.Property<int>("PersonId")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.Key("PersonId");
});
}
示例2: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta8-15964")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("PhoneSpotter.Models.PhoneSpotting", b =>
{
b.Property<int>("PhoneSpottingId")
.ValueGeneratedOnAdd();
b.Property<double>("Latitude");
b.Property<double>("Longitude");
b.Property<string>("Notes");
b.Property<string>("PhoneManufacturer");
b.Property<string>("PhoneModel");
b.Property<DateTime>("SpotTime");
b.HasKey("PhoneSpottingId");
});
}
示例3: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn);
modelBuilder.Entity("ASP5.Template.Core.Entities.Manufacturer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.Key("Id");
});
modelBuilder.Entity("ASP5.Template.Core.Entities.Model", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.Key("Id");
});
}
示例4: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta8-15964")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ConsoleApp2.Model.ChildA", b =>
{
b.Property<int>("ChildAId")
.ValueGeneratedOnAdd();
b.Property<string>("Data");
b.HasKey("ChildAId");
});
modelBuilder.Entity("ConsoleApp2.Model.Parent", b =>
{
b.Property<int>("ParentId")
.ValueGeneratedOnAdd();
b.Property<int?>("ChildAChildAId");
b.Property<string>("Data");
b.HasKey("ParentId");
});
modelBuilder.Entity("ConsoleApp2.Model.Parent", b =>
{
b.HasOne("ConsoleApp2.Model.ChildA")
.WithMany()
.ForeignKey("ChildAChildAId");
});
}
示例5: BuildModel
public override void BuildModel(ModelBuilder builder)
{
builder
.Annotation("ProductVersion", "7.0.0-beta6-13815");
builder.Entity("OoadProjekatBaza.RestoranBaza.Models.Restoran", b =>
{
b.Property<int>("RestoranId")
.ValueGeneratedOnAdd();
b.Property<float>("GeoDuzina");
b.Property<float>("GeoSirina");
b.Property<string>("Naziv");
b.Property<string>("Opis");
b.Property<float>("Rating");
b.Property<byte[]>("Slika")
.Annotation("Relational:ColumnType", "image");
b.Property<string>("Telefon");
b.Property<string>("fourSqaureId");
b.Key("RestoranId");
});
}
示例6: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn);
modelBuilder.Entity("Core.Blog", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Author");
b.Property<string>("Description");
b.Property<string>("Name");
b.Key("Id");
});
modelBuilder.Entity("Core.Follower", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("BlogId");
b.Property<string>("FirstName");
b.Key("Id");
});
modelBuilder.Entity("Core.Post", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("BlogId");
b.Property<string>("Date");
b.Property<string>("Text");
b.Key("Id");
});
modelBuilder.Entity("Core.Follower", b =>
{
b.Reference("Core.Blog")
.InverseCollection()
.ForeignKey("BlogId");
});
modelBuilder.Entity("Core.Post", b =>
{
b.Reference("Core.Blog")
.InverseCollection()
.ForeignKey("BlogId");
});
}
示例7: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540");
modelBuilder.Entity("Web_Api_Sample.Models.Customer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Address");
b.Property<string>("City");
b.Property<string>("CompanyName");
b.Property<string>("ContactTitle");
b.Property<string>("Fax");
b.Property<string>("Phone");
b.Property<string>("PostalCode");
b.Property<string>("Region");
b.Key("Id");
});
}
示例8: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta8-15964")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ImageLoader.Models.Entities.Image", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTimeOffset>("CreatedDate");
b.Property<bool>("IsActive");
b.Property<string>("Site")
.IsRequired()
.Annotation("MaxLength", 128);
b.Property<string>("URL")
.IsRequired();
b.Property<DateTimeOffset>("UpdatedDate");
b.HasKey("Id");
});
}
示例9: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta8-15964")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Fortes.Models.Categoria", b =>
{
b.Property<string>("Id");
b.Property<string>("Nome")
.IsRequired();
b.HasKey("Id");
});
modelBuilder.Entity("Fortes.Models.Despesa", b =>
{
b.Property<string>("Id");
b.Property<string>("CategoriaId");
b.Property<DateTime>("Data");
b.Property<string>("Observacao");
b.Property<decimal>("Valor");
b.HasKey("Id");
});
modelBuilder.Entity("Fortes.Models.Receita", b =>
{
b.Property<string>("Id");
b.Property<string>("CategoriaId");
b.Property<DateTime>("Data");
b.Property<string>("Observacao");
b.Property<decimal>("Valor");
b.HasKey("Id");
});
modelBuilder.Entity("Fortes.Models.Despesa", b =>
{
b.HasOne("Fortes.Models.Categoria")
.WithMany()
.ForeignKey("CategoriaId");
});
modelBuilder.Entity("Fortes.Models.Receita", b =>
{
b.HasOne("Fortes.Models.Categoria")
.WithMany()
.ForeignKey("CategoriaId");
});
}
示例10: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta8-15964");
modelBuilder.Entity("EF7.MyEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("MyColumn");
b.Property<int>("MyNumber");
b.HasKey("Id");
b.Annotation("Relational:TableName", "MyEntity");
});
modelBuilder.Entity("EF7.MySecondEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("MyColumn");
b.Property<int>("MyNumber");
b.HasKey("Id");
b.Annotation("Relational:TableName", "MySecondEntity");
});
}
示例11: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn);
modelBuilder.Entity("Recipe06.Dal.Entities.Artist", b =>
{
b.Property<int>("ArtistId")
.ValueGeneratedOnAdd();
b.Property<string>("City")
.Annotation("MaxLength", 50);
b.Property<string>("Country")
.Annotation("MaxLength", 50);
b.Property<DateTime>("CreateDate");
b.Property<string>("Provence")
.Annotation("MaxLength", 50);
b.Property<string>("UserName")
.Required()
.Annotation("MaxLength", 50);
b.Key("ArtistId");
});
modelBuilder.Entity("Recipe06.Dal.Entities.ArtistSkill", b =>
{
b.Property<int>("ArtistSkillId")
.ValueGeneratedOnAdd();
b.Property<int?>("ArtistArtistId");
b.Property<string>("Details")
.Annotation("MaxLength", 255);
b.Property<int>("SkillLevel");
b.Property<string>("Styles")
.Required()
.Annotation("MaxLength", 255);
b.Property<string>("TalentName")
.Required()
.Annotation("MaxLength", 50);
b.Key("ArtistSkillId");
});
modelBuilder.Entity("Recipe06.Dal.Entities.ArtistSkill", b =>
{
b.Reference("Recipe06.Dal.Entities.Artist")
.InverseCollection()
.ForeignKey("ArtistArtistId");
});
}
示例12: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn);
modelBuilder.Entity("TeamUtils.LeadTimeTrackingHelper.Domain.Data.Activity", b =>
{
b.Property<string>("Key");
b.Key("Key");
});
modelBuilder.Entity("TeamUtils.LeadTimeTrackingHelper.Domain.Data.Change", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ActivityKey");
b.Property<string>("FromKey");
b.Property<DateTime>("Timestamp");
b.Property<string>("ToKey");
b.Key("Id");
});
modelBuilder.Entity("TeamUtils.LeadTimeTrackingHelper.Domain.Data.State", b =>
{
b.Property<string>("Key");
b.Key("Key");
});
modelBuilder.Entity("TeamUtils.LeadTimeTrackingHelper.Domain.Data.Tag", b =>
{
b.Property<string>("Key");
b.Key("Key");
});
modelBuilder.Entity("TeamUtils.LeadTimeTrackingHelper.Domain.Data.Change", b =>
{
b.Reference("TeamUtils.LeadTimeTrackingHelper.Domain.Data.Activity")
.InverseCollection()
.ForeignKey("ActivityKey");
b.Reference("TeamUtils.LeadTimeTrackingHelper.Domain.Data.State")
.InverseCollection()
.ForeignKey("FromKey");
b.Reference("TeamUtils.LeadTimeTrackingHelper.Domain.Data.State")
.InverseCollection()
.ForeignKey("ToKey");
});
}
示例13: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540");
modelBuilder.Entity("playgroud_asp_schedule.Models.Event", b =>
{
b.Property<int>("event_id")
.ValueGeneratedOnAdd();
b.Property<int>("location_id");
b.Property<DateTime>("start");
b.Property<DateTime>("stop");
b.Property<int>("user_id");
b.Key("event_id");
});
modelBuilder.Entity("playgroud_asp_schedule.Models.Location", b =>
{
b.Property<int>("location_id")
.ValueGeneratedOnAdd();
b.Property<string>("name")
.Required()
.Annotation("MaxLength", 50);
b.Key("location_id");
});
modelBuilder.Entity("playgroud_asp_schedule.Models.User", b =>
{
b.Property<int>("user_id")
.ValueGeneratedOnAdd();
b.Property<string>("name")
.Required()
.Annotation("MaxLength", 50);
b.Key("user_id");
});
modelBuilder.Entity("playgroud_asp_schedule.Models.Event", b =>
{
b.Reference("playgroud_asp_schedule.Models.Location")
.InverseCollection()
.ForeignKey("location_id");
b.Reference("playgroud_asp_schedule.Models.User")
.InverseCollection()
.ForeignKey("user_id");
});
}
示例14: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540")
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn);
modelBuilder.Entity("Lpa.Site.Models.ChurchEvent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("ContactId")
.Required();
b.Property<DateTime>("Date");
b.Property<string>("Description")
.Annotation("MaxLength", 1500);
b.Property<bool>("IsRecurring")
.Annotation("Relational:DefaultValue", "False")
.Annotation("Relational:DefaultValueType", "System.Boolean");
b.Property<string>("Name")
.Required()
.Annotation("MaxLength", 50);
b.Key("Id");
b.Annotation("Relational:Schema", "dbo");
b.Annotation("Relational:TableName", "Events");
});
modelBuilder.Entity("Lpa.Site.Models.ChurchMember", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.Annotation("MaxLength", 150);
b.Key("Id");
b.Annotation("Relational:Schema", "dbo");
b.Annotation("Relational:TableName", "Members");
});
modelBuilder.Entity("Lpa.Site.Models.ChurchEvent", b =>
{
b.Reference("Lpa.Site.Models.ChurchMember")
.InverseCollection()
.ForeignKey("ContactId");
});
}
示例15: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.Annotation("ProductVersion", "7.0.0-beta7-15540");
modelBuilder.Entity("Models.Blog", b =>
{
b.Property<int>("BlogId")
.ValueGeneratedOnAdd()
.Annotation("Relational:ColumnName", "blog_id");
b.Property<string>("Name")
.Required();
b.Property<string>("Url")
.Required();
b.Key("BlogId");
b.Annotation("Relational:TableName", "blogs");
});
modelBuilder.Entity("Models.Post", b =>
{
b.Property<int>("PostId")
.ValueGeneratedOnAdd()
.Annotation("Relational:ColumnName", "post_id");
b.Property<int>("Blogid")
.Annotation("Relational:ColumnName", "blog_id");
b.Property<string>("Content")
.Required();
b.Property<DateTime>("Created")
.ValueGeneratedOnAdd();
b.Property<DateTime>("LastUpdated")
.ValueGeneratedOnAddOrUpdate();
b.Property<string>("Title")
.Required();
b.Key("PostId");
b.Annotation("Relational:TableName", "posts");
});
modelBuilder.Entity("Models.Post", b =>
{
b.Reference("Models.Blog")
.InverseCollection()
.ForeignKey("Blogid");
});
}