Intial commit. THe bare bones of a REST .NET Core app have been made.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using SecureCore.Models;
|
||||
|
||||
namespace SecureCore.Services
|
||||
{
|
||||
public class DataService : IDataService
|
||||
{
|
||||
private readonly List<Employee> Employees = new List<Employee>();
|
||||
|
||||
public DataService()
|
||||
{
|
||||
Employees.Add(new Employee() { ID = 0, Name = "Number 1" });
|
||||
Employees.Add(new Employee() { ID = 1, Name = "Number 2" });
|
||||
Employees.Add(new Employee() { ID = 2, Name = "Number 3" });
|
||||
Employees.Add(new Employee() { ID = 3, Name = "Number 4" });
|
||||
}
|
||||
|
||||
public List<Employee> Get()
|
||||
{
|
||||
return Employees;
|
||||
}
|
||||
|
||||
public Employee GetById(int id)
|
||||
{
|
||||
return Employees.Single(x => x.ID == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using SecureCore.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SecureCore.Services
|
||||
{
|
||||
public interface IDataService
|
||||
{
|
||||
List<Employee> Get();
|
||||
Employee GetById(int id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user