3
Answers

How to combine 2 fields in a linq

Ramco Ramco

Ramco Ramco

2y
473
1

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<TrainingModuleMaster> GetRecordDetailsByTypeId(Int32 ID)
        {
            try
            {
                List<TrainingModuleMaster> Result = (from t in context.TrainingModuleMasters
                                               where t.TrainingTypeID == ID
                                               select t).ToList();
                return Result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks

Answers (3)