точно-точно готово
This commit is contained in:
parent
1ad47faea0
commit
a003aff777
@ -1,14 +1,5 @@
|
|||||||
using FishFactoryDataModel.Models;
|
using FishFactoryDataModel.Models;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using FishFactoryContracts.BusinessLogicsContracts;
|
using FishFactoryContracts.BusinessLogicsContracts;
|
||||||
using FishFactoryContracts.SearchModels;
|
using FishFactoryContracts.SearchModels;
|
||||||
using FishFactoryContracts.BindingModels;
|
using FishFactoryContracts.BindingModels;
|
||||||
|
@ -9,7 +9,7 @@ namespace FishFactoryDatabaseImplement
|
|||||||
{
|
{
|
||||||
if (optionsBuilder.IsConfigured == false)
|
if (optionsBuilder.IsConfigured == false)
|
||||||
{
|
{
|
||||||
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FishFactory;Username=postgres;Password=postgres");
|
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FishFactory2;Username=postgres;Password=postgres");
|
||||||
}
|
}
|
||||||
base.OnConfiguring(optionsBuilder);
|
base.OnConfiguring(optionsBuilder);
|
||||||
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
|
||||||
|
@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace FishFactoryDatabaseImplement.Migrations
|
namespace FishFactoryDatabaseImplement.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(FishFactoryDatabase))]
|
[DbContext(typeof(FishFactoryDatabase))]
|
||||||
[Migration("20240319164852_InitialCreate")]
|
[Migration("20240320065127_InitialCreate")]
|
||||||
partial class InitialCreate
|
partial class InitialCreate
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
|
|
||||||
namespace FishFactoryDatabaseImplement.Models
|
namespace FishFactoryDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
public class Canned
|
public class Canned : ICannedModel
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
|
@ -3,10 +3,11 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
using FishFactoryDataModel.Enums;
|
using FishFactoryDataModel.Enums;
|
||||||
using FishFactoryContracts.BindingModels;
|
using FishFactoryContracts.BindingModels;
|
||||||
using FishFactoryContracts.ViewModels;
|
using FishFactoryContracts.ViewModels;
|
||||||
|
using FishFactoryDataModel.Models;
|
||||||
|
|
||||||
namespace FishFactoryDatabaseImplement.Models
|
namespace FishFactoryDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
public class Order
|
public class Order : IOrderModel
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
[Required]
|
[Required]
|
||||||
@ -27,6 +28,7 @@ namespace FishFactoryDatabaseImplement.Models
|
|||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
CannedId = model.CannedId,
|
CannedId = model.CannedId,
|
||||||
|
Canned = context.Canneds.First(x => x.Id == model.CannedId),
|
||||||
Count = model.Count,
|
Count = model.Count,
|
||||||
Sum = model.Sum,
|
Sum = model.Sum,
|
||||||
Status = model.Status,
|
Status = model.Status,
|
||||||
|
Loading…
Reference in New Issue
Block a user