Christoc.Modules.DnnChat.Components.MessageController.GetRecentMessages C# (CSharp) Méthode

GetRecentMessages() public méthode

public GetRecentMessages ( int moduleId, int hoursBackInTime, int maxRecords, System.Guid roomId ) : IEnumerable
moduleId int
hoursBackInTime int
maxRecords int
roomId System.Guid
Résultat IEnumerable
        public IEnumerable<Message> GetRecentMessages(int moduleId, int hoursBackInTime, int maxRecords, Guid roomId)
        {
            var messages = (from a in GetMessages(moduleId, roomId) where a.MessageDate.Subtract(DateTime.UtcNow).TotalHours <= hoursBackInTime && a.IsDeleted==false select a).Take(maxRecords).Reverse();

            return messages.Any() ? messages : null;
        }