Hi
In below linq query i want to return 2 fields . I want to combine CourseCode & Name as a single field.
Id,Coursecode_name
public List
{
try
{
List
where t.TrainingTypeID == ID
select t).ToList();
return Result;
}
catch (Exception ex)
{
throw ex;
}
}
Thanks

Vishal YelveRank #178 · 13.6K reputationPosted Sep 9, 2022, 10:58 AM EDT
Try this
(from t in context.TrainingModuleMasters where t.TrainingTypeID == ID select new { CourseName = t.CourseCode + " " + t.Name }).ToList();Ramco RamcoRank #462 · 5.4K reputationPosted Sep 9, 2022, 11:58 AM EDT
Vishal JoshiRank #377 · 6.7K reputationPosted Sep 9, 2022, 11:54 PM EDT