I have two tables `ExportCSV` and `ExportCSV2` that are updated every 30 minutes by a procedure. They are identical.

```
public class ExportCSV
{

    [Key]
    public int ID { get; set; }

    public int ClientId { get; set; }
    public string LinkedInId { get; set; }
    public string SNUrl { get; set; }
    public string Fullname { get; set; }
    public string Firstname { get; set; }
    public string Lastname { get; set; }
    public string Organization1 { get; set; }
    public string JobTitle { get; set; }
    public string ExperienceDescr { get; set; }
    ...

```

}

And

```
    public class ExportCSV2
{

    [Key]
    public int ID { get; set; }

    public int ClientId { get; set; }
    public string LinkedInId { get; set; }
    public string SNUrl { get; set; }
    public string Fullname { get; set; }
    public string Firstname { get; set; }
    public string Lastname { get; set; }
    public string Organization1 { get; set; }
    public string JobTitle { get; set; }
    public string ExperienceDescr { get; set; }
    ...

```

}

Depending on which table is updated last I select data in the service layer.

```
 public IQueryable GetExportByClientId(ref string tablename, int ClientId, DateTime? dateFrom, DateTime? dateTo)
    {
        var table = dataContext.GeneralSettings.FirstOrDefault(x => x.Key == "ActiveTableFullExport");
        if (table != null)
        {
            tablename = table.Value;

            if (table.Value.Equals("ExportCSV"))
            {
                if (dateFrom == null || dateTo == null)
                    return dataContext.ExportCSV.Where(x => x.ClientId == ClientId);
                else
                    return dataContext.ExportCSV.Where(x => x.ClientId == ClientId && x.StartDate > dateFrom && x.StartDate < dateTo);
            }
            else
            {
                if (dateFrom == null || dateTo == null)
                    return dataContext.ExportCSV2.Where(x => x.ClientId == ClientId);
                else
                    return dataContext.ExportCSV2.Where(x => x.ClientId == ClientId && x.StartDate > dateFrom && x.StartDate < dateTo);
            }
        }

        return null;
    }

```

The problem arises when the query returns from `ExportCSV2`
In that case, I get an exception 

```
System.ArgumentException: 'DbOfTypeExpression requires an expression argument with a polymorphic result type that is compatible with the type argument.'

 public ActionResult GenerateCsvReportByClient(int clientId, DateTime? dateFrom , DateTime? dateTo)
    {

        var query = _fanService.GetExportByClientId(ref tableName ,clientId, dateFrom, dateTo);

        var data = query.OfType<ExportCSV>().ToList();

var fans = data.Select(x => new ExportCSViewModel
            {
                LinkedInId = x.LinkedInId,
                SNUrl = x.SNUrl,
                Fullname = x.Fullname,
                Firstname = x.Firstname,
                Lastname =x.Lastname,
                Organization1 = x.Organization1,
                JobTitle = x.JobTitle,
   }).ToList();

```

How can I map the view model in both cases, not to be depended of the type of the model?