Brewage.Importers.BeerXML10.BeerXML10Importer.FileToEntity C# (CSharp) Method

FileToEntity() public method

public FileToEntity ( Stream source ) : Contracts.RECIPES
source Stream
return Contracts.RECIPES
        public Contracts.RECIPES FileToEntity(Stream source)
        {
            var ms = new MemoryStream();

            // TODO - this is bad...generates a dynamic assembly that will stick around forever
            // need to cache any transforms we are going to do
            //
            var transform = new XslCompiledTransform();
            transform.Load(@"\brewsker\Maps\BeerXMLToBrewskerXML.xslt");

            transform.Transform(new XPathDocument(source), null, ms);
            ms.Position = 0;

            var serializer = new DataContractSerializer(typeof(Contracts.RECIPES));

            var recipes = (Contracts.RECIPES)serializer.ReadObject(ms);
            return recipes;
        }

Same methods

BeerXML10Importer::FileToEntity ( string fileContents ) : RECIPES