多租户应用程序设计

This commit is contained in:
administrator committed 2024-07-05 19:25:58 +08:00
1 parent dbabaaadba
commit 49f2796cc2
24 files changed
+116 -25

No files matched your search

@@ -1,4 +1,7 @@
using Microsoft.AspNetCore.Mvc;
// Copyright (c) HelloShop Corporation. All rights reserved.
// See the license file in the project root for more information.
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MultiTenancySample.DatabaseIsolationService.Entities;
using MultiTenancySample.DatabaseIsolationService.EntityFrameworks;
@@ -23,5 +26,14 @@ namespace MultiTenancySample.DatabaseIsolationService.Controllers
return Ok(products);
}
[HttpPost]
public async Task<IActionResult> CreateProduct(Product product)
{
await _dbContext.AddAsync(product);
await _dbContext.SaveChangesAsync();
return Ok(product);
}
}
}