19 instantiations of ContentResult
BasicWebSite (1)
Filters\TestExceptionFilter.cs (1)
17context.Result = new ContentResult() { Content = "Exception was handled in TestExceptionFilter", StatusCode = 200 };
ControllersFromServicesClassLibrary (3)
ControllerWithConstructorInjection.cs (1)
35return new ContentResult { Content = content };
Inventory.cs (1)
13return new ContentResult { Content = "4" };
TimeScheduleController.cs (1)
13return new ContentResult { Content = "No schedules available for " + id };
ControllersFromServicesWebSite (1)
AnotherController.cs (1)
14return new ContentResult { Content = "1" };
CorsWebSite (1)
Filters\AllRequestsBlockingAuthorizationFilter.cs (1)
14context.Result = new ContentResult()
Microsoft.AspNetCore.Mvc.Core (1)
ControllerBase.cs (1)
287return new ContentResult
Microsoft.AspNetCore.Mvc.Core.Test (5)
ContentResultTest.cs (3)
27var contentResult = new ContentResult 122var contentResult = new ContentResult 225var contentResult = new ContentResult
Infrastructure\ActionMethodExecutorTest.cs (2)
464public IActionResult ReturnIActionResult() => new ContentResult(); 466public ContentResult ReturnsIActionResultSubType() => new ContentResult();
Microsoft.AspNetCore.Mvc.RazorPages (2)
PageBase.cs (1)
254return new ContentResult
PageModel.cs (1)
586return new ContentResult
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
Infrastructure\ExecutorFactoryTest.cs (4)
229return new ContentResult 254return Task.FromResult(new ContentResult 274return new ContentResult 299return Task.FromResult(new ContentResult
RazorPagesWebSite (1)
Pages\PropertyBinding\PolymorphicBinding.cs (1)
21return new ContentResult { Content = UserModel.ToString() };
109 references to ContentResult
BasicWebSite (8)
Controllers\AsyncActionsController.cs (8)
76public async Task<ContentResult> TaskOfContentResultAction(string message) 82public async Task<ContentResult> TaskOfContentResultExceptionAction(string message) 108public ValueTask<ContentResult> PreCompletedValueTaskOfContentResultAction(string message) 110return new ValueTask<ContentResult>(Content(message)); 113public ValueTask<ContentResult> PreCompletedValueTaskOfContentResultExceptionAction(string message) 150public CustomAwaitable<ContentResult> CustomAwaitableOfContentResultAction(string message) 152return new CustomAwaitable<ContentResult>(SimulateDelayMilliseconds, Content(message)); 155public CustomAwaitable<ContentResult> CustomAwaitableOfContentResultExceptionAction(string message)
Microsoft.AspNetCore.Mvc.Core (17)
ContentResult.cs (1)
35var executor = context.HttpContext.RequestServices.GetRequiredService<IActionResultExecutor<ContentResult>>();
ControllerBase.cs (12)
238/// Creates a <see cref="ContentResult"/> object by specifying a <paramref name="content"/> string. 241/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 243public virtual ContentResult Content(string content) 247/// Creates a <see cref="ContentResult"/> object by specifying a 252/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 254public virtual ContentResult Content(string content, string contentType) 258/// Creates a <see cref="ContentResult"/> object by specifying a 264/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 270public virtual ContentResult Content(string content, string contentType, Encoding contentEncoding) 278/// Creates a <see cref="ContentResult"/> object by specifying a 283/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 285public virtual ContentResult Content(string content, MediaTypeHeaderValue? contentType)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
245services.TryAddSingleton<IActionResultExecutor<ContentResult>, ContentResultExecutor>();
Infrastructure\ContentResultExecutor.cs (3)
14/// A <see cref="IActionResultExecutor{ContentResult}"/> that is responsible for <see cref="ContentResult"/> 16public partial class ContentResultExecutor : IActionResultExecutor<ContentResult> 34public virtual async Task ExecuteAsync(ActionContext context, ContentResult result)
Microsoft.AspNetCore.Mvc.Core.Test (22)
ContentResultTest.cs (4)
27var contentResult = new ContentResult 122var contentResult = new ContentResult 225var contentResult = new ContentResult 267services.AddSingleton<IActionResultExecutor<ContentResult>>(new ContentResultExecutor(
ControllerBaseTest.cs (14)
2186var actualContentResult = controller.Content("TestContent"); 2189Assert.IsType<ContentResult>(actualContentResult); 2201var actualContentResult = controller.Content("TestContent", "text/plain"); 2204Assert.IsType<ContentResult>(actualContentResult); 2217var actualContentResult = controller.Content("TestContent", "text/plain", Encoding.UTF8); 2220Assert.IsType<ContentResult>(actualContentResult); 2233var contentResult = (ContentResult)contentController.Content_WithNoEncoding(); 2248var contentResult = (ContentResult)contentController.Content_WithInvalidCharset(); 2265var contentResult = (ContentResult)contentController.Content_WithEncodingInCharset_AndEncodingParameter(); 2279var contentResult = (ContentResult)contentController.Content_WithEncodingInCharset();
Infrastructure\ActionMethodExecutorTest.cs (4)
61Assert.IsType<ContentResult>(valueTask.Result); 86Assert.IsType<ContentResult>(valueTask.Result); 198Assert.IsType<ContentResult>(valueTask.Result); 466public ContentResult ReturnsIActionResultSubType() => new ContentResult();
Microsoft.AspNetCore.Mvc.RazorPages (24)
PageBase.cs (12)
208/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 212/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 213public virtual ContentResult Content(string content) 217/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 222/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 223public virtual ContentResult Content(string content, string contentType) 227/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 233/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 238public virtual ContentResult Content(string content, string contentType, Encoding contentEncoding) 246/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 251/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 252public virtual ContentResult Content(string content, MediaTypeHeaderValue? contentType)
PageModel.cs (12)
540/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 544/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 545public virtual ContentResult Content(string content) 549/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 554/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 555public virtual ContentResult Content(string content, string contentType) 559/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 565/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 570public virtual ContentResult Content(string content, string contentType, Encoding contentEncoding) 578/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a 583/// <returns>The created <see cref="ContentResult"/> object for the response.</returns> 584public virtual ContentResult Content(string content, MediaTypeHeaderValue? contentType)
Microsoft.AspNetCore.Mvc.RazorPages.Test (34)
Infrastructure\ExecutorFactoryTest.cs (6)
70var contentResult = Assert.IsType<ContentResult>(actionResult); 159var contentResult = Assert.IsType<ContentResult>(actionResult); 252public Task<ContentResult> TaskReturningConcreteSubtype(string arg = "value") 297public Task<ContentResult> TaskReturningConcreteSubtype(string arg = "value")
PageModelTest.cs (14)
1571var actualContentResult = pageModel.Content("TestContent"); 1574Assert.IsType<ContentResult>(actualContentResult); 1586var actualContentResult = pageModel.Content("TestContent", "text/plain"); 1589Assert.IsType<ContentResult>(actualContentResult); 1602var actualContentResult = pageModel.Content("TestContent", "text/plain", Encoding.UTF8); 1605Assert.IsType<ContentResult>(actualContentResult); 1618var contentResult = (ContentResult)contentPageModel.Content_WithNoEncoding(); 1633var contentResult = (ContentResult)contentPageModel.Content_WithInvalidCharset(); 1650var contentResult = (ContentResult)contentPageModel.Content_WithEncodingInCharset_AndEncodingParameter(); 1664var contentResult = (ContentResult)contentPageModel.Content_WithEncodingInCharset();
PageTest.cs (14)
1561var actualContentResult = page.Content("TestContent"); 1564Assert.IsType<ContentResult>(actualContentResult); 1576var actualContentResult = page.Content("TestContent", "text/plain"); 1579Assert.IsType<ContentResult>(actualContentResult); 1592var actualContentResult = page.Content("TestContent", "text/plain", Encoding.UTF8); 1595Assert.IsType<ContentResult>(actualContentResult); 1608var contentResult = (ContentResult)contentPage.Content_WithNoEncoding(); 1623var contentResult = (ContentResult)contentPage.Content_WithInvalidCharset(); 1640var contentResult = (ContentResult)contentPage.Content_WithEncodingInCharset_AndEncodingParameter(); 1654var contentResult = (ContentResult)contentPage.Content_WithEncodingInCharset();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ControllerUnitTestabilityTests.cs (2)
75var contentResult = Assert.IsType<ContentResult>(result);
Mvc.RoutingWebSite (2)
Pages\LGAnotherPage.cshtml.cs (1)
18public ContentResult OnGet()
Pages\LGPage.cshtml.cs (1)
18public ContentResult OnGet()