public void BuildPackage_ToFile() { var packageBuilder = new ClientNugetPackageBuilder(TypeMapper); using (var fileStream = File.Create(packageBuilder.PackageFileName)) { packageBuilder.BuildPackage(fileStream); } }
public void BuildPackage_DoesNotThrowAnyExceptions() { var packageBuilder = new ClientNugetPackageBuilder(TypeMapper); byte[] fileData; using (var fileStream = new MemoryStream()) { packageBuilder.BuildPackage(fileStream); fileData = fileStream.ToArray(); } Console.WriteLine("Package size is " + fileData.Length/1024.0 + " KiB"); }
public void BuildPackage_DoesNotThrowAnyExceptions() { var packageBuilder = new ClientNugetPackageBuilder(TypeMapper); byte[] fileData; using (var fileStream = new MemoryStream()) { packageBuilder.BuildPackage(fileStream); fileData = fileStream.ToArray(); } Console.WriteLine("Package size is " + fileData.Length / 1024.0 + " KiB"); }
private Response GetClientNugetPackage() { var packageBuilder = new ClientNugetPackageBuilder(TypeMapper); byte[] bytes; using (var memstream = new MemoryStream()) { packageBuilder.BuildPackage(memstream); bytes = memstream.ToArray(); } var response = new Response { Contents = stream => stream.Write(bytes, 0, bytes.Length), ContentType = "application/zip", }; return(response); }
private Response GetClientNugetPackage() { var response = new Response(); var packageBuilder = new ClientNugetPackageBuilder(this.typeMapper); response.Contents = stream => { using (var memstream = new MemoryStream()) { packageBuilder.BuildPackage(memstream); var bytes = memstream.ToArray(); stream.Write(bytes, 0, bytes.Length); } }; response.ContentType = "binary/octet-stream"; return response; }