本文整理汇总了C#中ModelBuilder.HasAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C# ModelBuilder.HasAnnotation方法的具体用法?C# ModelBuilder.HasAnnotation怎么用?C# ModelBuilder.HasAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelBuilder
的用法示例。
在下文中一共展示了ModelBuilder.HasAnnotation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("BooksServiceSample.Models.BookChapter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("Relational:ColumnType", "UniqueIdentifier")
.HasAnnotation("Relational:GeneratedValueSql", "newid()");
b.Property<int>("Number");
b.Property<int>("Pages");
b.Property<string>("Title")
.HasAnnotation("MaxLength", 120);
b.HasKey("Id");
b.HasAnnotation("Relational:TableName", "Chapters");
});
}
示例2: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ASP.NET_Core_SPAs.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("EmailAddress")
.HasAnnotation("MaxLength", 200);
b.Property<string>("Name")
.IsRequired()
.HasAnnotation("MaxLength", 200);
b.Property<string>("PhoneNumber");
b.Property<string>("UserId");
b.HasKey("Id");
});
}
示例3: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("BPE.Players.Player", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<string>("FirstName");
b.Property<DateTime?>("LastModificationTime");
b.Property<string>("LastName");
b.Property<int>("LoginCount");
b.HasKey("Id");
b.ToTable("Players");
});
}
示例4: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("WebApi_Identity_Provider_DotNet.Models.Credential", b =>
{
b.Property<string>("UserId")
.HasAnnotation("MaxLength", 256);
b.Property<string>("PublicKeyHash");
b.Property<string>("ActiveChallenge");
b.Property<string>("DeviceName")
.IsRequired();
b.Property<string>("PublicKey")
.IsRequired();
b.HasKey("UserId", "PublicKeyHash");
b.ToTable("Credentials");
});
}
开发者ID:FranceConnectSamples,项目名称:franceconnect-identity-provider-dotnet-webapi-aspnetcore,代码行数:26,代码来源:ApplicationDbContextModelSnapshot.cs
示例5: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.1")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("hwnn.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.HasKey("Id");
b.ToTable("Contacts");
});
modelBuilder.Entity("hwnn.Models.Customer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("CustomerName");
b.HasKey("Id");
b.ToTable("Customers");
});
}
示例6: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
modelBuilder.Entity("Sannel.House.Thermostat.Base.Models.Device", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("DateCreated");
b.Property<DateTime>("DateModified");
b.Property<string>("Description");
b.Property<int>("DisplayOrder");
b.Property<bool>("IsReadOnly");
b.Property<string>("Name");
b.HasKey("Id");
b.ToTable("Devices");
});
}
示例7: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.1");
modelBuilder.Entity("cloudscribe.Core.IdentityServer.EFCore.Entities.PersistedGrant", b =>
{
b.Property<string>("Key");
b.Property<string>("Type");
b.Property<string>("ClientId")
.IsRequired()
.HasAnnotation("MaxLength", 200);
b.Property<DateTime>("CreationTime");
b.Property<string>("Data")
.IsRequired();
b.Property<DateTime>("Expiration");
b.Property<string>("SiteId")
.IsRequired()
.HasAnnotation("MaxLength", 36);
b.Property<string>("SubjectId");
b.HasKey("Key", "Type");
b.HasIndex("SiteId");
b.ToTable("csids_PersistedGrants");
});
}
示例8: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc2-16254")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("EFFoo2.Entities.Customer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
});
modelBuilder.Entity("EFFoo2.Entities.Supplier", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
});
}
示例9: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
modelBuilder.Entity("Example2.EmployeeEntity", b =>
{
b.Property<int>("EmpId")
.ValueGeneratedOnAdd();
b.Property<int>("Age");
b.Property<string>("FirstName")
.IsRequired();
b.Property<string>("LastName")
.IsRequired();
b.HasKey("EmpId");
b.HasAnnotation("Relational:TableName", "Employee");
});
modelBuilder.Entity("Example2.JobEntity", b =>
{
b.Property<int>("JobId")
.ValueGeneratedOnAdd();
b.Property<string>("JobDesc");
b.HasKey("JobId");
b.HasAnnotation("Relational:TableName", "Job");
});
}
示例10: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ContactsBackEnd.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Address");
b.Property<DateTime?>("BirthDate");
b.Property<string>("City");
b.Property<string>("Email");
b.Property<string>("FirstName");
b.Property<string>("LastName");
b.Property<string>("Telephone");
b.Property<int>("ZipCode");
b.HasKey("Id");
});
}
示例11: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc2-16413")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Benchmarks.Data.Fortune", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Message")
.HasAnnotation("MaxLength", 2048);
b.HasKey("Id");
});
modelBuilder.Entity("Benchmarks.Data.World", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("RandomNumber");
b.HasKey("Id");
});
}
示例12: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
modelBuilder.Entity("GoogleCloudSamples.Models.Book", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Author");
b.Property<string>("CreatedBy");
b.Property<string>("CreatedById");
b.Property<string>("Description");
b.Property<string>("ImageUrl");
b.Property<DateTime?>("PublishedDate");
b.Property<string>("Title");
b.HasKey("Id");
});
}
开发者ID:SurferJeffAtGoogle,项目名称:getting-started-dotnet,代码行数:27,代码来源:ApplicationDbContextModelSnapshot.cs
示例13: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
modelBuilder.Entity("JF.Models.ColorItem", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("ID");
});
modelBuilder.Entity("JF.Models.UnitItem", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("ID");
});
}
示例14: BuildTargetModel
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
modelBuilder.Entity("Sannel.House.Logging.Models.ApplicationLogEntry", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationId");
b.Property<int?>("DeviceId");
b.Property<DateTime>("EntryDateTime");
b.Property<string>("Exception");
b.Property<string>("Message");
b.Property<bool>("Synced");
b.HasKey("Id");
b.ToTable("ApplicationLogEntries");
});
}
示例15: BuildModel
protected override void BuildModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "7.0.0-rc1-16147")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("EFRels.Lib.Entities.Club", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
});
modelBuilder.Entity("EFRels.Lib.Entities.Team", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("ClubId");
b.Property<string>("Name");
b.HasKey("Id");
});
modelBuilder.Entity("EFRels.Lib.Entities.Team", b =>
{
b.HasOne("EFRels.Lib.Entities.Club")
.WithMany()
.HasForeignKey("ClubId");
});
}