我第一次使用Ado.net实体框架,我需要在将其插入数据库之前检查该记录是否存在.我最好搜索是否存在AuthodSSID而不是密钥(AuthorID).我正在使用VS2010,Framework 4. System.Data.Entity是3.5.0.0.
我用Google搜索,但没有找到这个问题的答案.
PublishingCompanyEntities publishContext;
publishContext = new PublishingCompanyEntities();
private void createNew_Click(object sender, EventArgs e)
{
Author newAuthor = new Author();
newAuthor.FirstName = firstName.Text;
newAuthor.LastName = lastName.Text;
newAuthor.AuthodSSID = 20;
newAuthor.AuthorID = 10
//Check if record exist here
publishContext.AddToAuthor(newAuthor);//insert if does not exist
}
Run Code Online (Sandbox Code Playgroud) 如何使用JSF2.0引用图像库子文件夹中的文件?

我已经尝试了很多方法使用库和名称标签,但最合乎逻辑的似乎是下面的那个,但它不起作用!
<h:graphicImage library="images" name="Mecearia\4382982_med.jpg"/>
Run Code Online (Sandbox Code Playgroud)
服务器总是返回
WARNING: JSF1064: Unable to find or serve resource, Mecearia\4382982_med.jpg, from library, images.
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?