SqlMetal wrongly generates the return type of my stored proc (LINQ)
问题 Hi have a stored proc that always returns a single row depending of a parameter: IF @bleh = 1 SELECT TOP 1 Xyz FROM Abc ELSE SELECT TOP 1 Def FROM Abc I must use SqlMetal to generate the DataContext but this stored procedure returns a IMultipleResults , which is an error. Instead it should return a ISingleResult ... If I remove the if (putting a single SELECT call), an ISingleResult return type is generated. Any ideas? 回答1: The scenario you're describing is by design. I've tested with both