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


C# ModelBuilder.Annotation方法代码示例

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

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

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

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

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

示例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");
                });
        }
开发者ID:tingvast,项目名称:EF7-Sandbox,代码行数:60,代码来源:20150930135733_v4.Designer.cs

示例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");
                });
        }
开发者ID:okusnadi,项目名称:AspNet5-Web-Api-Sample,代码行数:29,代码来源:WestWindContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:atarason,项目名称:ImageLoader-vNext,代码行数:27,代码来源:ImageLoaderDbContextModelSnapshot.cs

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

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

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

示例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");
                });
        }
开发者ID:nvsnkv,项目名称:LeadTimeTrackingHelper,代码行数:58,代码来源:20151004125415_Remove_Tags.Designer.cs

示例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");
                });
        }
开发者ID:NoelJames,项目名称:playgroud-asp-schedule,代码行数:56,代码来源:SchedulingContextModelSnapshot.cs

示例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");
                });
        }
开发者ID:nteague22,项目名称:LPA-Site,代码行数:56,代码来源:20151002052024_FixingCircular.Designer.cs

示例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");
                });
        }
开发者ID:erlimar,项目名称:blog.erlimar.com,代码行数:55,代码来源:20151007165933_Start.Designer.cs


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