fiogf49gjkf0d I am trying to find the largest job number currently in the database in the entity Project.
Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IProject> rep = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IProject>(); Sage.Platform.Repository.ICriteria criteria = rep.CreateCriteria(); criteria.Add(rep.EF.Eq("ProjectType", "Insurance")); criteria.AddOrder(rep.EF.Asc("JobNumber")); criteria.SetProjection(rep.PF.Property("JobNumber")); criteria.SetMaxResults(1); Sage.Entity.Interfaces.IProject project = criteria.UniqueResult<Sage.Entity.Interfaces.IProject>();
Even when I take out the ProjectType criteria, I get nothing returned. Does anyone have any thoughts on why this wouldn't be working? |