public Entities.Mail GetMail(IMessageExp exp) { var query = Query() .Where(exp.GetExpression()); return(Db.ExecuteList(query) .ConvertAll(ToMail) .SingleOrDefault()); }
public Entities.Mail GetNextMail(IMessageExp exp) { var query = Query() .Where(exp.GetExpression()) .OrderBy(MailTable.Columns.Id, true) .SetMaxResults(1); var mail = Db.ExecuteList(query) .ConvertAll(ToMail) .SingleOrDefault(); return(mail); }