
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
	<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head><card id="MainCard" title="&#x6B22;&#x8FCE;&#x5149;&#x4E34;"><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a><br/>&nbsp;</p><p><b>&#x6807;&#x9898;&#x3A;</b> &#x45;&#x6E;&#x74;&#x69;&#x74;&#x79;&#x20;&#x46;&#x72;&#x61;&#x6D;&#x65;&#x77;&#x6F;&#x72;&#x6B;&#x20;&#x50;&#x6F;&#x77;&#x65;&#x72;&#x20;&#x54;&#x6F;&#x6F;&#x6C;&#x73;&#x20;&#x42;&#x65;&#x74;&#x61;&#x20;&#x32;&#x751F;&#x6210;&#x4EE3;&#x7801;&#x7ED3;&#x6784;</p><p><b>&#x4F5C;&#x8005;&#x3A;</b> &#x64;&#x6E;&#x61;&#x77;&#x6F;</p><p><b>&#x65E5;&#x671F;&#x3A;</b> &#x32;&#x30;&#x31;&#x32;&#x2D;&#x30;&#x38;&#x2D;&#x31;&#x36;&#x20;&#x30;&#x36;&#x3A;&#x31;&#x37;&#x20;&#x50;&#x4D;</p><p><b>&#x5206;&#x7C7B;&#x3A;</b> <a href="wap.asp?do=showLog&amp;cateID=5">&#x57;&#x65;&#x62;&#x7F16;&#x7A0B;</a></p><p><b>&#x5185;&#x5BB9;&#x3A;</b> &#x4E00;&#x3001;test&#x5E93;&#x7ED3;&#x6784;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;Cr&#101;ate TABLE [dbo].[CategoryTB](<br/>&#160;&#160;&#160;&#160;[Id] [int] IDENTITY(1,1) NOT NULL,<br/>&#160;&#160;&#160;&#160;[Name] [nvarchar](50) NULL,<br/> CONSTRAINT [PK_CategoryTB] PRIMARY KEY CLUSTERED <br/>(<br/>&#160;&#160;&#160;&#160;[Id] ASC<br/>)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]<br/>) ON [PRIMARY]<br/>Cr&#101;ate TABLE [dbo].[UserTB](<br/>&#160;&#160;&#160;&#160;[Id] [int] IDENTITY(1,1) NOT NULL,<br/>&#160;&#160;&#160;&#160;[CategoryId] [int] NOT NULL,<br/>&#160;&#160;&#160;&#160;[Usn] [nvarchar](20) NOT NULL,<br/>&#160;&#160;&#160;&#160;[Pwd] [nvarchar](20) NOT NULL,<br/>&#160;&#160;&#160;&#160;[Cr&#101;ated] [datetime] NULL,<br/> CONSTRAINT [PK__UserTB] PRIMARY KEY CLUSTERED <br/>(<br/>&#160;&#160;&#160;&#160;[Id] ASC<br/>)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]<br/>) ON [PRIMARY]<br/>GO<br/>Alt&#101;r TABLE [dbo].[UserTB]&nbsp;&nbsp;WITH CHECK ADD&nbsp;&nbsp;CONSTRAINT [FK_UserTB_CategoryTB] FOREIGN KEY([CategoryId])<br/>REFERENCES [dbo].[CategoryTB] ([Id])<br/>&#x4E8C;&#x3001;Entity Framework Power Tools Beta 2&#x751F;&#x6210;&#x4EE3;&#x7801;<br/>1&#x3001;Mapping<br/>Models\Mapping\CategoryTBMap.cs&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;using System.ComponentModel.DataAnnotations;<br/>using System.Data.Entity.ModelConfiguration;<br/>namespace ConsoleApplication1.Models.Mapping<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;public class CategoryTBMap : EntityTypeConfiguration&lt;CategoryTB&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public CategoryTBMap()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Primary Key<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.HasKey(t =&gt; t.Id);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Properties<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Name)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.HasMaxLength(50);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Table &amp; Column Mappings<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.ToTable(&#34;CategoryTB&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Id).HasColumnName(&#34;Id&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Name).HasColumnName(&#34;Name&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>Models\Mapping\UserTBMap.cs&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;using System.ComponentModel.DataAnnotations;<br/>using System.Data.Entity.ModelConfiguration;<br/>namespace ConsoleApplication1.Models.Mapping<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;public class UserTBMap : EntityTypeConfiguration&lt;UserTB&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public UserTBMap()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Primary Key<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.HasKey(t =&gt; t.Id);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Properties<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Usn)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.IsRequired()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.HasMaxLength(20);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Pwd)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.IsRequired()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.HasMaxLength(20);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Table &amp; Column Mappings<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.ToTable(&#34;UserTB&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Id).HasColumnName(&#34;Id&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.CategoryId).HasColumnName(&#34;CategoryId&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Usn).HasColumnName(&#34;Usn&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Pwd).HasColumnName(&#34;Pwd&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.Property(t =&gt; t.Cr&#101;ated).HasColumnName(&#34;Cr&#101;ated&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Relationships<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.HasRequired(t =&gt; t.CategoryTB)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.WithMany(t =&gt; t.UserTBs)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.HasForeignKey(d =&gt; d.CategoryId);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>2&#x3001;Models<br/>Models\CategoryTB.cs&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;using System;<br/>using System.Collections.Generic;<br/>namespace ConsoleApplication1.Models<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;public class CategoryTB<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public CategoryTB()<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.UserTBs = new List&lt;UserTB&gt;();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public int Id { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public string Name { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public virtual ICollection&lt;UserTB&gt; UserTBs { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>Models\UserTB.cs&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;using System;<br/>using System.Collections.Generic;<br/>namespace ConsoleApplication1.Models<br/>{<br/>&nbsp;&nbsp;&nbsp;&nbsp;public class UserTB<br/>&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public int Id { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public int CategoryId { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public string Usn { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public string Pwd { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public Nullable&lt;System.DateTime&gt; Cr&#101;ated { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public virtual CategoryTB CategoryTB { get; set; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}<br/>3&#x3001;Context<br/>Models\testContext.cs&#xFF1A;<br/>&#x590D;&#x5236;&#x5185;&#x5BB9;&#x5230;&#x526A;&#x8D34;&#x677F; &#x7A0B;&#x5E8F;&#x4EE3;&#x7801;using System.Data.Entity;<br/>using System.Data.Entity.Infrastructure;<br/>using ConsoleApplication1.Models.Mapping;<br/>namespace ConsoleApplication1.Models<br/>{<br/>&#160;&#160;&#160;&#160;public class testContext : DbContext<br/>&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;static testContext()<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Database.SetInitializer&lt;testContext&gt;(null);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public testContext()<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;: base(&#34;Name=testContext&#34;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public DbSet&lt;CategoryTB&gt; CategoryTBs { get; set; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public DbSet&lt;UserTB&gt; UserTBs { get; set; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;protected override void OnModelCreating(DbModelBuilder modelBuilder)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;modelBuilder.Configurations.Add(new CategoryTBMap());<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;modelBuilder.Configurations.Add(new UserTBMap());<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;}<br/>}</p><p> + <a href="#CommentCard">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x65E5;&#x5FD7;&#x8BC4;&#x8BBA;</a> (0)</p><p>&nbsp;<br/><br/><a href="wap.asp?do=Login">&#x767B;&#x5F55;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.625&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="postCommentCard"><p><b>&#x6807;&#x9898;&#x3A;</b> <a href="#MainCard">&#x45;&#x6E;&#x74;&#x69;&#x74;&#x79;&#x20;&#x46;&#x72;&#x61;&#x6D;&#x65;&#x77;&#x6F;&#x72;&#x6B;&#x20;&#x50;&#x6F;&#x77;&#x65;&#x72;&#x20;&#x54;&#x6F;&#x6F;&#x6C;&#x73;&#x20;&#x42;&#x65;&#x74;&#x61;&#x20;&#x32;&#x751F;&#x6210;&#x4EE3;&#x7801;&#x7ED3;&#x6784;</a></p><p><br/>你没有权限发表评论</p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.625&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="CommentCard"><p>&#x6682;&#x65E0;&#x8BC4;&#x8BBA;</p><p><a href="#MainCard">&#x8FD4;&#x56DE;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.625&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card>
</wml>
