From a296ec399b423d220a853bbe67d1173200d3cd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 19 Mar 2023 15:14:01 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D1=87=D0=B0=D1=81=D1=82=D1=8C=20=D1=81=20=D1=83=D1=87=D0=B5?= =?UTF-8?q?=D1=82=D0=BE=D0=BC=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileImplementationExtension.cs | 1 + ConfectionaryFileImplement/Shop.cs | 8 ++++++++ .../ListImplementationExtension.cs | 1 + Confectionery/Program.cs | 9 +++++++++ .../DatabaseImplementationExtension.cs | 1 + ConfectioneryDatabaseImplement/Shop.cs | 8 ++++++++ 6 files changed, 28 insertions(+) diff --git a/ConfectionaryFileImplement/FileImplementationExtension.cs b/ConfectionaryFileImplement/FileImplementationExtension.cs index c643c48..e5a38fc 100644 --- a/ConfectionaryFileImplement/FileImplementationExtension.cs +++ b/ConfectionaryFileImplement/FileImplementationExtension.cs @@ -16,6 +16,7 @@ namespace ConfectioneryFileImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); } diff --git a/ConfectionaryFileImplement/Shop.cs b/ConfectionaryFileImplement/Shop.cs index 928faf6..949be69 100644 --- a/ConfectionaryFileImplement/Shop.cs +++ b/ConfectionaryFileImplement/Shop.cs @@ -2,23 +2,30 @@ using ConfectioneryContracts.ViewModels; using ConfectioneryDataModels; using ConfectioneryDataModels.Models; +using System.Runtime.Serialization; using System.Xml.Linq; namespace ConfectioneryFileImplement { + [DataContract] public class Shop : IShopModel { + [DataMember] public string Name { get; private set; } = string.Empty; + [DataMember] public string Address { get; private set; } = string.Empty; + [DataMember] public int MaxCountPastries { get; private set; } + [DataMember] public DateTime DateOpening { get; private set; } public Dictionary CountPastries { get; private set; } = new(); private Dictionary? _cachedPastries = null; + [DataMember] public Dictionary Pastries { get @@ -34,6 +41,7 @@ namespace ConfectioneryFileImplement } } + [DataMember] public int Id { get; private set; } public static Shop? Create(ShopBindingModel? model) diff --git a/ConfectionaryListImplement/ListImplementationExtension.cs b/ConfectionaryListImplement/ListImplementationExtension.cs index 5aa4fd4..c29e394 100644 --- a/ConfectionaryListImplement/ListImplementationExtension.cs +++ b/ConfectionaryListImplement/ListImplementationExtension.cs @@ -21,6 +21,7 @@ namespace ConfectioneryListImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); } diff --git a/Confectionery/Program.cs b/Confectionery/Program.cs index 3ca4057..5349e2f 100644 --- a/Confectionery/Program.cs +++ b/Confectionery/Program.cs @@ -69,6 +69,7 @@ namespace ConfectioneryView DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(true); @@ -89,6 +90,14 @@ namespace ConfectioneryView DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); } private static void MailCheck(object obj) => DependencyManager.Instance.Resolve()?.MailCheck(); diff --git a/ConfectioneryDatabaseImplement/DatabaseImplementationExtension.cs b/ConfectioneryDatabaseImplement/DatabaseImplementationExtension.cs index f9d3c85..6492523 100644 --- a/ConfectioneryDatabaseImplement/DatabaseImplementationExtension.cs +++ b/ConfectioneryDatabaseImplement/DatabaseImplementationExtension.cs @@ -16,6 +16,7 @@ namespace ConfectioneryDatabaseImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); } diff --git a/ConfectioneryDatabaseImplement/Shop.cs b/ConfectioneryDatabaseImplement/Shop.cs index 190e58d..cc4e49c 100644 --- a/ConfectioneryDatabaseImplement/Shop.cs +++ b/ConfectioneryDatabaseImplement/Shop.cs @@ -7,25 +7,32 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; using System.Xml.Linq; namespace ConfectioneryDatabaseImplement.Models { + [DataContract] public class Shop : IShopModel { [Required] + [DataMember] public string Name { get; private set; } = string.Empty; [Required] + [DataMember] public string Address { get; private set; } = string.Empty; [Required] + [DataMember] public int MaxCountPastries { get; private set; } + [DataMember] public DateTime DateOpening { get; private set; } private Dictionary? _cachedPastries = null; [NotMapped] + [DataMember] public Dictionary Pastries { get @@ -41,6 +48,7 @@ namespace ConfectioneryDatabaseImplement.Models } } + [DataMember] public int Id { get; private set; } [ForeignKey("ShopId")]