Big problem with fluent nhibernate, c# and MySQL need to search in BLOB
- by VinnyG
I've done a big mistake, now I have to find a solution. It was my first project working with fluent nhibernate, I mapped an object this way :
public PosteCandidateMap()
{
Id(x => x.Id);
Map(x => x.Candidate);
Map(x => x.Status);
Map(x => x.Poste);
Map(x => x.MatchPossibility);
Map(x => x.ModificationDate);
}
So the whole Poste object is in the database but I would have need only the PosteId. Now I got to find all Candidates for one Poste so when I look in my repository I have :
return GetAll().Where(x => x.Poste.Id == id).ToList();
But this is very slow since it loads all the items, we now have more than 1500 items in the table, at first to project was not supposed to be that big (not a big paycheck either). Now I'm trying to do this with criterion ou Linq but it's not working since my Poste is in a BLOB.
Is there anyway I can change this easyly?
Thanks a lot for the help!