I have two tables in my database Element and Entity, given an el_id(element id) i would like to extract the ent_id(entity id) from the Element table and ent_type_id(Entity type) from Entity table, i have an ent_id column common in both the tables but it is int in Element table and String in the Entity table, following is the code, help me resolve it.
var ent_ids = _context.Elements.Where(e => el_ids.Contains(e.el_id)).Select(el => el.ent_id);
var ent_type_ids = _context.Entities.Where(e => ent_ids.Contains(e.ent_id)).Select(el => el.ent_type_id);
Error:
Instance argument: cannot convert from 'System.Linq.IQueryable(string)' to 'System.Linq.ParallelQuery(int)'
This comes for the second line of the code.
Edit: added models from comment below.
Entities Model:
public partial class Entity
{
public int ent_id { get; set; }
public Nullable<int> document_id { get; set; }
}
Elements Model:
public partial class Element
{
public int el_id { get; set; }
public string ent_id { get; set; }
}