ох
This commit is contained in:
commit
25546c801e
@ -6,11 +6,13 @@ namespace ElectronicsShopDataBaseImplement
|
||||
{
|
||||
public class Database : DbContext
|
||||
{
|
||||
//DESKTOP-E2VPEN3
|
||||
//DESKTOP-O0N00SH
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder
|
||||
optionsBuilder)
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false) {
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-O0N00SH\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace ElectronicsShopDataBaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(Database))]
|
||||
[Migration("20240527175902_InitMigration")]
|
||||
partial class InitMigration
|
||||
[Migration("20240528050446_Init")]
|
||||
partial class Init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace ElectronicsShopDataBaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitMigration : Migration
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -62,6 +62,19 @@ namespace ElectronicsShopRestAPI.Controllers {
|
||||
|
||||
[HttpPost]
|
||||
public void CreateOrder(OrderBindingModel model) {
|
||||
try
|
||||
{
|
||||
_order.CreateOrder(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Ошибка создания заказа");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void CreateProduct(OrderBindingModel model) {
|
||||
return;
|
||||
}
|
||||
//Мейби нужны будут удаления, обновления, выбор конкретного заказа или продукта. Короче потом...
|
||||
|
Loading…
x
Reference in New Issue
Block a user