Question 3


Question

Drag and Drop
You are developing an ASP.NET MVC Web API image management for RentBin.ca rental application.

The application must meet the following requirements:
— It must send or receive image data without the use of a buffer.
— It must allow up to 4 MB of image data to be received.
— It must allow up to 3 MB of image data to be sent.

You need to complete the code to meet the requirements. What should you do? (To answer, drag the appropriate code segments to the correct location or locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

  • config
  • config
  • config
  • server
  • MaxBufferSize
  • MaxReceivedMessageSize
  • MaxConcurrentRequests
  • Streamed
  • Buffered
class Program
{
private static string _baseAddress = "http://localhost:8080/";
static void Main(string[] args)
{
var config = new HttpSelfHostConfiguration(_baseAddress);
config.Routes.MapHttpRoute(name:"DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new {id = RouteParameter.Optional});
    .
      = 1024 * 1024 * 3;
        .
          = 1024 * 1024 * 4;
            .TransferMode = TransferMode.

              var server = new HttpSelfHostServer(config);
              server.OpenAsync().Wait();
              }
              }

              Answer:

              • server
              • MaxConcurrentRequests
              • Buffered
              class Program
              {
              private static string _baseAddress = "http://localhost:8080/";
              static void Main(string[] args)
              {
              var config = new HttpSelfHostConfiguration(_baseAddress);
              config.Routes.MapHttpRoute(name:"DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new {id = RouteParameter.Optional});
              • config
              .
              • MaxBufferSize
              = 1024 * 1024 * 3;
              • config
              .
              • MaxReceivedMessageSize
              = 1024 * 1024 * 4;
              • config
              .TransferMode = TransferMode.
              • Streamed

              var server = new HttpSelfHostServer(config);
              server.OpenAsync().Wait();
              }
              }