Skip to content

Commit 6a80f63

Browse files
committed
samples project updated
1 parent 8d74f0f commit 6a80f63

4 files changed

Lines changed: 50 additions & 8 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System.Collections.Generic ;
2+
using Microsoft.AspNetCore.Mvc;
3+
4+
namespace PartialResponse.AspNetCore.Mvc.Demo.Controllers
5+
{
6+
public class ExecutorController : Controller
7+
{
8+
public IActionResult Index()
9+
{
10+
var response = new List<dynamic>()
11+
{
12+
new
13+
{
14+
Foo = 1,
15+
Bar = new
16+
{
17+
Baz = 2,
18+
Qux = 3
19+
}
20+
},
21+
new
22+
{
23+
Foo = 2,
24+
Bar = new
25+
{
26+
Baz = 3,
27+
Qux = 4
28+
}
29+
},
30+
new
31+
{
32+
Foo = 3,
33+
Bar = new
34+
{
35+
Baz = 5,
36+
Qux = 6
37+
}
38+
}
39+
};
40+
41+
return this.PartialJson(response);
42+
}
43+
}
44+
}

samples/PartialResponse.AspNetCore.Mvc.Demo/Controllers/HomeController.cs renamed to samples/PartialResponse.AspNetCore.Mvc.Demo/Controllers/FormatterController.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using System.Collections.Generic ;
22
using Microsoft.AspNetCore.Mvc;
33

4-
namespace WebApplication.Controllers
4+
namespace PartialResponse.AspNetCore.Mvc.Demo.Controllers
55
{
6-
public class HomeController : Controller
6+
public class FormatterController : Controller
77
{
88
public List<dynamic> Index()
99
{
10-
var response = new List<dynamic>()
10+
return new List<dynamic>()
1111
{
1212
new
1313
{
@@ -37,8 +37,6 @@ public List<dynamic> Index()
3737
}
3838
}
3939
};
40-
41-
return response;
4240
}
4341
}
4442
}

samples/PartialResponse.AspNetCore.Mvc.Demo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.IO;
22
using Microsoft.AspNetCore.Hosting;
33

4-
namespace WebApplication
4+
namespace PartialResponse.AspNetCore.Mvc.Demo
55
{
66
public class Program
77
{

samples/PartialResponse.AspNetCore.Mvc.Demo/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.Extensions.Logging;
66
using PartialResponse.Extensions.DependencyInjection;
77

8-
namespace WebApplication
8+
namespace PartialResponse.AspNetCore.Mvc.Demo
99
{
1010
public class Startup
1111
{
@@ -48,7 +48,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
4848
{
4949
routes.MapRoute(
5050
name: "default",
51-
template: "{controller=Home}/{action=Index}/{id?}");
51+
template: "{controller=Home}/{action=Index}");
5252
});
5353
}
5454
}

0 commit comments

Comments
 (0)