public GetShippingOptionsResponse Invoke(GetShippingOptionsRequest request) { using (var sr = new StreamReader(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"App_Data\Shipping.xml"))) { var ser = sr.ReadToEnd(); var response = new GetShippingOptionsResponse() { ShippingOptions = SerializationHelper. DataContractDeserialize <Dictionary <string, ShippingBase> >(ser) }; return(response); } }
protected Basket GetBasket() { if (!File.Exists(file)) { return new Basket { LineItems = new List <LineItem>(), } } ; using (var sr = new StreamReader(file)) { return(SerializationHelper.DataContractDeserialize <Basket>(sr.ReadToEnd())); } }