草庐IT

publishContext

全部标签

c# - 插入新记录前检查记录是否存在

我是第一次使用Ado.netEntityFramework,在将它插入数据库之前,我需要检查它是否存在。最好我会搜索AuthodSSID是否存在而不是key(AuthorID)。我正在使用VS2010,Framework4。System.Data.Entity是3.5.0.0。我用谷歌搜索,但没有找到这个问题的答案。PublishingCompanyEntitiespublishContext;publishContext=newPublishingCompanyEntities();privatevoidcreateNew_Click(objectsender,EventArgse)