Skip to content

Commit 927ae91

Browse files
ASP.NET Core: Complete functionality implementation with proper Employee endpoints
1 parent 0bc852d commit 927ae91

File tree

13 files changed

+596
-1068
lines changed

13 files changed

+596
-1068
lines changed

ASP.NET Core/Controllers/HomeController.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
using System.Threading.Tasks;
55
using Microsoft.AspNetCore.Mvc;
66

7-
namespace ASP_NET_Core.Controllers;
8-
public class HomeController: Controller {
9-
public IActionResult Index() {
10-
return View();
11-
}
7+
namespace ASP_NET_Core.Controllers
8+
{
9+
public class HomeController : Controller
10+
{
11+
public IActionResult Index()
12+
{
13+
return View();
14+
}
1215

13-
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
14-
public IActionResult Error() {
15-
return View();
16+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
17+
public IActionResult Error() {
18+
return View();
19+
}
1620
}
1721
}

ASP.NET Core/Controllers/SampleDataController.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,19 @@ public class SampleDataController: Controller {
1515

1616
[HttpGet]
1717
public object Get(DataSourceLoadOptions loadOptions) {
18-
return DataSourceLoader.Load(SampleData.Orders, loadOptions);
18+
return DataSourceLoader.Load(SampleData.GetEmployees(), loadOptions);
19+
}
20+
21+
[HttpPost]
22+
public object Post(string values)
23+
{
24+
return Ok();
25+
}
26+
27+
[HttpPut]
28+
public object Put(int key, string values)
29+
{
30+
return Ok();
1931
}
2032

2133
}

ASP.NET Core/Controllers/orig_HomeController.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

ASP.NET Core/Controllers/orig_SampleDataController.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

ASP.NET Core/Models/orig_Employee.cs renamed to ASP.NET Core/Models/Employee.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Newtonsoft.Json;
1+
using Newtonsoft.Json;
22
using System;
33
using System.ComponentModel.DataAnnotations;
44

0 commit comments

Comments
 (0)