示例#1
0
        /// <summary>
        /// returns all quotes
        /// </summary>
        /// <returns></returns>
        public IEnumerable <quotable.core.Models.Quote> getAllQuotes()
        {
            var numQuotes = quoteList.Length;

            quotable.core.Models.Quote[] returnList = new quotable.core.Models.Quote[numQuotes];
            for (int i = 0; i < numQuotes; i++)
            {
                returnList[i] = quoteList[i];
            }
            IEnumerable <quotable.core.Models.Quote> returnQuotes = returnList;

            return(returnQuotes);
        }
示例#2
0
        /// <summary>
        /// This method takes an input of the number of quotes to be provided and returns an IEnumerable List of quotes.
        /// </summary>
        /// <param name="numQuotes"></param>
        /// <returns></returns>
        ///
        public IEnumerable <quotable.core.Models.Quote> getQuotes(long numQuotes)
        {
            quotable.core.Models.Quote[] returnList = new quotable.core.Models.Quote[numQuotes];
            for (int i = 0; i < numQuotes; i++)
            {
                Random random      = new Random();
                int    randomQuote = random.Next(0, 3);
                returnList[i] = quoteList[randomQuote];
            }
            IEnumerable <quotable.core.Models.Quote> returnQuotes = returnList;

            return(returnQuotes);
        }