|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace WcfSample
{
// NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in Web.config and in the associated .svc file.
public class Stocks : IStock
{
#region IStock Members
public Stock GetStock(string Symbol)
{
Stock st = null;
switch (Symbol.ToUpper())
{
case "GOOG":
st = new Stock { Symbol = Symbol, Date = DateTime.Now, Company = "Google Inc.", Close = 495 };
break;
case "MSFT":
st = new Stock { Symbol = Symbol, Date = DateTime.Now, Company = "Microsoft Corporation", Close = 25 };
break;
case "YHOO":
st = new Stock { Symbol = Symbol, Date = DateTime.Now, Company = "Yahoo! Inc.", Close = 17 };
break;
case "AMZN":
st = new Stock { Symbol = Symbol, Date = DateTime.Now, Company = "Amazon.com, Inc.", Close = 92 };
break;
}
return st;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.