RBS
asked on
Converting SQL Procedure to LINQ
Hi:
I'm a bit panicked trying to do a major change from an internet cafe on my vacation - so pls excuse simplicity of request -
Need to transfer the following sql query to Linq:
I have created a repository and am making modifications to it in following:
Any help in translating the query from the top to the area with the question marks below greatly appreciated!
RBS
Frozen Brain
I'm a bit panicked trying to do a major change from an internet cafe on my vacation - so pls excuse simplicity of request -
Need to transfer the following sql query to Linq:
SELECT Id,
CASE
WHEN CourseInstance>1 THEN
Name +
+ ' - ' +
CAST(Year(RegisterDate) AS varchar(4))+ '-' +
CAST(Month(RegisterDate) AS varchar(2))
ELSE Name
END AS Course,
FROM Enrollments
I have created a repository and am making modifications to it in following:
public IEnumerable<Enrollment> GetEnrollmentsByUserName(string userName)
{
return DbSet.Where(e => e.UserName == userName); ????????????????????
}
Any help in translating the query from the top to the area with the question marks below greatly appreciated!
RBS
Frozen Brain
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Roger