当前位置: 首页>>代码示例>>C#>>正文


C# ModelBuilder.HasAnnotation方法代码示例

本文整理汇总了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");
                });
        }
开发者ID:ProfessionalCSharp,项目名称:ProfessionalCSharp6,代码行数:25,代码来源:20151127223303_InitBooks.Designer.cs

示例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");
                });
        }
开发者ID:elanderson,项目名称:ASP.NET-Core-SPAs,代码行数:25,代码来源:20160205214715_Init.Designer.cs

示例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");
                });
        }
开发者ID:RedFoxTechnologies,项目名称:bpe,代码行数:26,代码来源:20160802204829_Initial.Designer.cs

示例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");
                });
        }
开发者ID:shukanov-artyom,项目名称:studies,代码行数:32,代码来源:InitialMigration.Designer.cs

示例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");
                });
        }
开发者ID:holtsoftware,项目名称:House,代码行数:27,代码来源:20160719185649_Inital.Designer.cs

示例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");
                });
        }
开发者ID:joeaudette,项目名称:cloudscribe,代码行数:35,代码来源:PersistedGrantDbContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:dneimke,项目名称:EFFoo,代码行数:26,代码来源:FooContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:cgideon,项目名称:EntityFrameworkDemo,代码行数:35,代码来源:MyContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:gobetti,项目名称:ContactsBackEnd,代码行数:30,代码来源:ContactsContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:nietras,项目名称:benchmarks,代码行数:27,代码来源:20151124205054_Fortune.Designer.cs

示例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");
                });
        }
开发者ID:csongysun,项目名称:JF,代码行数:25,代码来源:20160222121527_InitialMigration.Designer.cs

示例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");
                });
        }
开发者ID:holtsoftware,项目名称:House,代码行数:27,代码来源:20160826201319_Inital.Designer.cs

示例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");
                });
        }
开发者ID:dneimke,项目名称:EF7-Relationships,代码行数:35,代码来源:OneToManyContextModelSnapshot.cs


注:本文中的ModelBuilder.HasAnnotation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。