【问题标题】:Entity Framework Single Result ObjectResult实体框架单结果 ObjectResult
【发布时间】:2010-11-28 15:55:50
【问题描述】:

我有一个总是返回单行的存储过程
目前我的代码看起来像这样

public void DoSomthing()
{
    ObjectResult<pDoesProductExist_Result> pDoesProductExistResults = tbsDBEntities.pDoesProductExist(itemCode);
                foreach (pDoesProductExist_Result pDoesProductExistResult in pDoesProductExistResults)
                {
                   return;
                }
...
}

有更好的方法吗?

【问题讨论】:

    标签: c# .net asp.net entity-framework entity-framework-4


    【解决方案1】:
    pDoesProductExist_Result exists = tbsDBEntities.pDoesProductExist(itemCode).Single();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-09
      • 2019-11-10
      • 1970-01-01
      相关资源
      最近更新 更多