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