示例#1
0
    public BookInfo GetBookInfo(string isbn)
    {
        // Throw exception if isbn is not present
        if (isbn == null)
        {
            throw new Exception("Isbn not supplied");
        }

        // Get path to the data source
        string path = string.Format("{0}books.xml",
                                    HostingEnvironment.ApplicationPhysicalPath);

        // TODO: Tell the browser NOT to cache this object
        //WebOperationContext.Current.OutgoingResponse.Headers["cache-control"] = "no-store";

        // Return book
        return(BookInfo.GetBook(isbn, path));
    }