/// <summary> /// This method returns all created program of the given type. /// </summary> /// <param name="programType">This is the type of the program.</param> /// <returns>Program List.</returns> public static List <Program> GetAll(ProgramTypeEnum programType) { return(InMemoryDatabaseSingleton.DatabaseInstance.SelectMany <Program>( x => x.ProgramType == programType).OrderByDescending( x => x.CreationDate).ToList()); }
/// <summary> /// This gets the given program by type which was created last /// </summary> /// <param name="programTypeEnum"> The name of the program by type</param> public static Program Get(ProgramTypeEnum programTypeEnum) { return(InMemoryDatabaseSingleton.DatabaseInstance.SelectMany <Program>( x => x.ProgramType == programTypeEnum && x.IsCreated).OrderByDescending( x => x.CreationDate).First()); }