Ejemplo n.º 1
0
        /// <summary>
        ///     Returns the latest organisation name before specified date/time
        /// </summary>
        /// <param name="maxDate">Ignore name changes after this date/time - if empty returns the latest name</param>
        /// <returns>The name of the organisation</returns>
        public OrganisationName GetName(DateTime?maxDate = null)
        {
            if (maxDate == null || maxDate.Value == DateTime.MinValue)
            {
                maxDate = SectorType.GetAccountingStartDate().AddYears(1);
            }

            return(OrganisationNames.Where(n => n.Created < maxDate.Value).OrderByDescending(n => n.Created).FirstOrDefault());
        }
 /// <summary>
 ///     Returns the latest organisation name before specified date/time
 /// </summary>
 /// <param name="accountingDate">Ignore name changes after this date/time - if empty returns the latest name</param>
 /// <returns>The name of the organisation</returns>
 public OrganisationName GetName(DateTime accountingDate)
 {
     return(OrganisationNames.Where(n => n.Created < accountingDate)
            .OrderByDescending(n => n.Created)
            .FirstOrDefault());
 }