0
    ALTER PROCEDURE [dbo].[SearchData] 
    -- Add the parameters for the stored procedure here
    @searchparameter varchar(100)
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

SELECT cat.CategoryId,cat.CategoryImageURL,cat.CategoryName,cat.isDeleted,ap.AppCreatedBy,ap.AppCreatedOn
,ap.AppDetails,ap.AppId,ap.AppImageURL,ap.AppModifiedBy,ap.AppModifiedOn,ap.AppName,ap.isDeleted,subcat.SubCategoryId
,subcat.SubCategoryName,subcat.SubCategoryImageUrl
  FROM Category cat JOIN App ap
       ON cat.CategoryID = ap.CategoryID 
       Join SubCategory subcat ON subcat.SubCategoryId = ap.SubCategoryId   
  WHERE FREETEXT (cat.CategoryName, @searchparameter) OR  FREETEXT (subcat.SubCategoryName,@searchparameter) OR FREETEXT (ap.AppName,@searchparameter)
  OR CONTAINS (ap.AppDetails,@searchparameter) OR CONTAINS (cat.CategoryName, @searchparameter) OR  CONTAINS (subcat.SubCategoryName,@searchparameter) OR CONTAINS (ap.AppName,@searchparameter)
  OR CONTAINS (ap.AppDetails,@searchparameter) OR ap.AppName LIKE @searchparameter + '%' ORDER BY ap.AppName

END

但是当我从数据库更新模型时,存储过程在实体框架中显示返回类型为 int,尽管我想返回所有上述值。

请帮忙

4

1 回答 1

0

存储过程的返回类型始终为int.

您需要将其映射到在实体模型中返回复杂类型的函数。

于 2013-08-16T13:59:59.430 回答