Remove Employees and Customers from Backend

This commit is contained in:
Robin-Manuel Thiel 2018-04-28 12:39:57 +02:00
Родитель 6dcaf00116
Коммит f83dda5d4c
3 изменённых файлов: 3 добавлений и 25 удалений

Просмотреть файл

@ -46,4 +46,7 @@
<ItemGroup>
<WCFMetadata Include="Connected Services" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Controllers\EmployeeController.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,15 +0,0 @@
using System;
using ContosoMaintenance.WebAPI.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
namespace ContosoMaintenance.WebAPI.Controllers
{
//[Route("/api/customer")]
//public class CustomerController : BaseController<Customer>
//{
// public CustomerController(IConfiguration configuration) : base(configuration)
// {
// }
//}
}

Просмотреть файл

@ -14,15 +14,11 @@ namespace ContosoMaintenance.WebAPI.Controllers
public class DummyController : Controller
{
DocumentDBRepositoryBase<Job> jobs = new DocumentDBRepositoryBase<Job>();
DocumentDBRepositoryBase<Customer> customers = new DocumentDBRepositoryBase<Customer>();
DocumentDBRepositoryBase<Employee> employees = new DocumentDBRepositoryBase<Employee>();
DocumentDBRepositoryBase<Part> parts = new DocumentDBRepositoryBase<Part>();
public DummyController(IConfiguration configuration)
{
jobs.Initialize(configuration["AzureCosmosDb:Endpoint"], configuration["AzureCosmosDb:Key"], configuration["AzureCosmosDb:DatabaseId"]);
customers.Initialize(configuration["AzureCosmosDb:Endpoint"], configuration["AzureCosmosDb:Key"], configuration["AzureCosmosDb:DatabaseId"]);
employees.Initialize(configuration["AzureCosmosDb:Endpoint"], configuration["AzureCosmosDb:Key"], configuration["AzureCosmosDb:DatabaseId"]);
parts.Initialize(configuration["AzureCosmosDb:Endpoint"], configuration["AzureCosmosDb:Key"], configuration["AzureCosmosDb:DatabaseId"]);
}
@ -38,12 +34,6 @@ namespace ContosoMaintenance.WebAPI.Controllers
foreach (var item in container.Jobs)
await jobs.CreateItemAsync(item);
foreach (var item in container.Customers)
await customers.CreateItemAsync(item);
foreach (var item in container.Employees)
await employees.CreateItemAsync(item);
foreach (var item in container.Parts)
await parts.CreateItemAsync(item);