第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

EF 4.1 Code First 子類具有相同屬性時出錯如何解決

EF 4.1 Code First 子類具有相同屬性時出錯如何解決

MYYA 2018-12-07 05:30:35
表: CREATE TABLE [dbo].[Test](?[PKID] [uniqueidentifier] NOT NULL,?[Name] [nvarchar](50) NULL,?[AA] [nchar](10) NULL,?[BB] [nchar](10) NULL,?[CC] [nchar](10) NULL,?[DD] [nchar](10) NULL,?[EE] [nchar](10) NULL,?[FF] [nchar](10) NULL,?[TestType] [tinyint] NULL,?CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED (?[PKID] ASC)WITH (PAD_INDEX? = OFF, STATISTICS_NORECOMPUTE? = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS? = ON, ALLOW_PAGE_LOCKS? = ON) ON [PRIMARY]) ON [PRIMARY] GO ? 實(shí)體: public abstract class Test : Entity??? {??????? [Key]??????? public Guid PKID { get; set; }??????? public string Name { get; set; }??? } ??? public class A : Test??? {??????? public string BB { get; set; }??????? public string CC { get; set; }??????? public string DD { get; set; }??? }??? public class B : Test??? {??????? public string AA { get; set; }??????? public string BB { get; set; }??????? public string CC { get; set; }??????? public string DD { get; set; }??? }??? public class C : Test??? {??????? public string EE { get; set; }??????? public string FF { get; set; }??? } ? ??????????? modelBuilder.Entity<Test>()??????????? .Map<A>(m => m.Requires("TestType").HasValue((byte)0))??????????? .Map<B>(m => m.Requires("TestType").HasValue((byte)1))??????????? .Map<C>(m => m.Requires("TestType").HasValue((byte)2)); ? 當(dāng)向A實(shí)體插入記錄時,生成下面sql: exec sp_executesql N'insert [dbo].[Test]([PKID], [Name], [BB], [CC], [DD], [AA], [BB1], [CC1], [DD1], [EE], [FF], [TestType])values (@0, @1, @2, @3, @4, null, null, null, null, null, null, @5)',N'@0 uniqueidentifier,@1 nvarchar(max) ,@2 nvarchar(max) ,@3 nvarchar(max) ,@4 nvarchar(max) ,@5 tinyint',@0='B1264CFD-8E16-451D-B015-E9CE756EC7F9',@1=N'A',@2=N'bb',@3=N'cc',@4=N'dd',@5=0 請問為何BB,CC,DD變成了BB1,CC1,DD1?
查看完整描述

2 回答

?
料青山看我應(yīng)如是

TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超8個贊

怎么沒有解決方案?

查看完整回答
反對 回復(fù) 2019-01-21
  • 2 回答
  • 0 關(guān)注
  • 364 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號