Performance improvements, refactoring of multi-tenant support, split Alias and Tenant entities for cleaner separation of concerns, create an additional site during installation for demonstratng multitenancy

This commit is contained in:
Shaun Walker
2019-05-24 13:33:19 -04:00
parent 0067521cd5
commit 8deb119f36
57 changed files with 880 additions and 309 deletions

View File

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Oqtane.Repository;
using Oqtane.Models;
using System.Collections.Generic;
namespace Oqtane.Controllers
{
@ -16,9 +17,39 @@ namespace Oqtane.Controllers
// GET: api/<controller>
[HttpGet]
public Tenant Get()
public IEnumerable<Tenant> Get()
{
return tenants.GetTenant();
return tenants.GetTenants();
}
// GET api/<controller>/5
[HttpGet("{id}")]
public Tenant Get(int id)
{
return tenants.GetTenant(id);
}
// POST api/<controller>
[HttpPost]
public void Post([FromBody] Tenant site)
{
if (ModelState.IsValid)
tenants.AddTenant(site);
}
// PUT api/<controller>/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] Tenant site)
{
if (ModelState.IsValid)
tenants.UpdateTenant(site);
}
// DELETE api/<controller>/5
[HttpDelete("{id}")]
public void Delete(int id)
{
tenants.DeleteTenant(id);
}
}
}