nhibernate3 weaknesses
- by Adrakadabra
from the moment we've migrated from hibernate 2 to hibernate3 ,around 30% of queries can not execute anymore,while there were not any problem with the previous version. does anybody have such problems?
for example some of errors we see r like these
Specified cast is not valid:
Repository<CountrySubdivision>.Find(p => p.Parent.Id == parentId);
specified method is not supported:
public JsonResult AllEducationDegree(string search)
{
var data = Repository<EducationDegree>
.FindBySpecification(new EducationDegreeSpecification().Search(search))
.Take(10)
.Select(p => new NameValue(p.Title, (int)p.Id))
.ToList();
// .AsDropdown(" ");
return Json(data, JsonRequestBehavior.AllowGet);
}
public class EducationDegreeSpecification : FluentSpecification<EducationDegree>
{
public EducationDegreeSpecification Search(string EducationDegreeSearch)
{
if (!String.IsNullOrEmpty(EducationDegreeSearch))
{
string[] searchs = EducationDegreeSearch.Split(' ');
foreach (string search in searchs)
{
if (!String.IsNullOrEmpty(search))
{
AddExpression(p => p.Title.Contains(search));
}
}
}
return this;
}
}