Question: I need to retrieve an id's name (`assessment name`)

```
 public int GetAssessmentNo(int AssessmentNo)
        {
            int AssNo = (from a in contxt.View_Assessment
                         where a.id == AssessmentNo
                         select a.AssessmentName);
            return AssNo;
        }

```

Cannot implicitly convert type **System.Linq.IQueryable**' to **int**

Answer: 
Linq defaultly returns group of things, linq doesn't know that your id is uniq.

`(from a in contxt.View_Assessment where a.id == AssessmentNo select a.AssessmentName).First() or FirstOrDefault`.

if you want to receive default value if no proper item is found.
Your code actually returns a list (which probably in your case contains one item). Compiler can not convert a `IQueryable` into an `int`. You can do something like this to resolve the issue,

```
public int GetAssessmentNo(int AssessmentNo)
{
    return contxt.View_Assessment.First(a=> a.id == AssessmentNo).AssessmentName;
}

```