bool hasAuthorization() { if (Authorizations == null || Authorizations.Count == 0) { return(false); } else { var latestAuth = Authorizations.OrderByDescending(x => x.EndDate).FirstOrDefault(); if (latestAuth == null) { return(false); } else { if (latestAuth.EndDate < DateTime.Now.Date) { return(false); } else { return(true); } } } }