August 2018
Intermediate to advanced
298 pages
5h 33m
English
Scenario
You want to learn how to access the underlying stream of response of a string.
Aim
Write an activity result that would capitalize the given string.
Steps for completion
public class UpperStringActionResult : ActionResult{ readonly string str; public UpperStringActionResult(string str) { this.str = str; } public override void ExecuteResult(ActionContext context) { var upperStringBytes = Encoding.UTF8.GetBytes(str.ToUpper()); context.HttpContext.Response.Body.Write( upperStringBytes, 0, upperStringBytes.Length); }}
Read now
Unlock full access