точно-точно готово

This commit is contained in:
Алексей Тихоненков 2024-03-20 10:57:23 +04:00
parent 1ad47faea0
commit a003aff777
6 changed files with 6 additions and 13 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 />

View File

@ -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]

View File

@ -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,