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