Изменения из базовой части
This commit is contained in:
commit
3735eb81b8
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace ConfectioneryDatabaseImplement.Migrations
|
namespace ConfectioneryDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ConfectioneryDatabase))]
|
[DbContext(typeof(ConfectioneryDatabase))]
|
||||||
[Migration("20230304103151_add_entity_client")]
|
[Migration("20230307072144_add_client")]
|
||||||
partial class add_entity_client
|
partial class add_client
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -5,11 +5,12 @@
|
|||||||
namespace ConfectioneryDatabaseImplement.Migrations
|
namespace ConfectioneryDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class add_entity_client : Migration
|
public partial class add_client : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
|
migrationBuilder.Sql("TRUNCATE Orders");
|
||||||
migrationBuilder.AddColumn<int>(
|
migrationBuilder.AddColumn<int>(
|
||||||
name: "ClientId",
|
name: "ClientId",
|
||||||
table: "Orders",
|
table: "Orders",
|
@ -84,8 +84,7 @@ namespace ConfectioneryDatabaseImplement.Models
|
|||||||
return new()
|
return new()
|
||||||
{
|
{
|
||||||
PastryName = context.Pastries.FirstOrDefault(x => x.Id == PastryId)?.PastryName ?? string.Empty,
|
PastryName = context.Pastries.FirstOrDefault(x => x.Id == PastryId)?.PastryName ?? string.Empty,
|
||||||
// ??????
|
ClientFIO = Client?.ClientFIO ?? string.Empty,
|
||||||
ClientFIO = Client?.ClientFIO ?? context.Clients.FirstOrDefault(x => x.Id == ClientId)?.ClientFIO ?? string.Empty,
|
|
||||||
PastryId = PastryId,
|
PastryId = PastryId,
|
||||||
Count = Count,
|
Count = Count,
|
||||||
Sum = Sum,
|
Sum = Sum,
|
||||||
|
Loading…
Reference in New Issue
Block a user