AspNetEmailExample.Models.MailRecipient.getLastEmailDate C# (CSharp) Method

getLastEmailDate() public method

public getLastEmailDate ( ) : DateTime?
return DateTime?
        public DateTime? getLastEmailDate()
        {
            var top = (from m in this.SentMails
                       orderby m.SentDate descending
                       select m).Take(1);
            if (top.Count() > 0)
            {
                return top.ElementAt(0).SentDate;
            }
            else
            {
                return null;
            }
        }