I have no experience with the .NET **Entity Framework** and I have some doubts about what exactly do this query:

```
using (MyCorpo.EarlyWarnings.Model.EarlyWarningsEntities context = new Model.EarlyWarningsEntities()) 
{
    DBContext.SetTimeout(context);    

    model.VulnerabilitySeverityAverage = (from x in context.VulnerabilityAlertDocuments select x.Severity).Average();
}

```

(Where the type of the model.VulnerabilitySeverityAverage is simply a string)

So I think that **VulnerabilityAlertDocuments** map the **VulnerabilityAlertDocument database table** because into the **EarlyWarningsEntities** I have something this line:

```
public DbSet<VulnerabilityAlertDocument> VulnerabilityAlertDocuments { get; set; }

```

So I am executing a query on the **VulnerabilityAlertDocuments** DbSet object that represent a query on my **VulnerabilityAlertDocument** table on my database. Is it correct?

So what exatly do the previous query?

I think that it select the **Severity** field value of all records in the **VulnerabilityAlertDocument** table and calculate the avarage value from all these value.

Is it my reasoning correct?

How can I convert this entity query in a classic SQL query? Someone can help me?

Tnx