public ApplicationWarning GetLastApplicationWarning(string pMessage, int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<ApplicationWarning> hibernateRepository = new HibernateRepository<ApplicationWarning>(hibernateConnection))
         {
             var applicationWarning = hibernateRepository.FindMany(x => x.Message == pMessage && x.Application.Id == pId)
                                                         .OrderBy(x => x.DateTimeOfCreation)
                                                         .LastOrDefault();
             return applicationWarning;
         }
     }
 }
 public ApplicationWarning GetApplicationWarning(int pId)
 {
     using (HibernateConnection hibernateConnection = new HibernateConnection())
     {
         using (HibernateRepository<ApplicationWarning> hibernateRepository = new HibernateRepository<ApplicationWarning>(hibernateConnection))
         {
             var applicationWarning = hibernateRepository.FindMany(x => x.Application.Id == pId &&
                                                                        x.DateTimeOfStart <= DateTimeExtensions.UTCBrazilDateTime &&
                                                                        x.DateTimeOfEnd >= DateTimeExtensions.UTCBrazilDateTime)
                                                         .OrderBy(x => x.DateTimeOfCreation).FirstOrDefault();
             return applicationWarning;
         }
     }
 }