устала я уже, добавила реализации где надо и не надо, разобралась вроде с файловым хранилищем

This commit is contained in:
Елена Бакальская 2024-05-19 02:42:42 +04:00
parent 3072692dbe
commit 54854a1ac0
12 changed files with 59 additions and 15 deletions

View File

@ -3,7 +3,7 @@ namespace SushiBarContracts.BindingModel
{
public class MessageInfoBindingModel : IMessageInfoModel
{
public int Id { get; set; }
public int Id => throw new NotImplementedException();
public string MessageId { get; set; } = string.Empty;
public int? ClientId { get; set; }

View File

@ -6,7 +6,7 @@ namespace SushiBarContracts.ViewModels
public class MessageInfoViewModel : IMessageInfoModel
{
[Column(visible: false)]
public int Id { get; set; }
public int Id => throw new NotImplementedException();
[Column(visible: false)]
public string MessageId { get; set; } = string.Empty;

View File

@ -6,7 +6,7 @@ namespace SushiBarDatabaseImplement
{
public class DatabaseImplementationException : IImplementationExtension
{
public int Priority => 1;
public int Priority => 2;
public void RegisterServices()
{
DependencyManager.Instance.RegisterType<IClientStorage, ClientStorage>();

View File

@ -10,8 +10,7 @@ namespace SushiBarDatabaseImplement.Models
[DataContract]
public class MessageInfo : IMessageInfoModel
{
[NotMapped]
public int Id { get; set; }
public int Id => throw new NotImplementedException();
[DataMember]
[Key]

View File

@ -20,7 +20,6 @@
<ItemGroup>
<ProjectReference Include="..\SushiBarContracts\SushiBarContracts.csproj" />
<ProjectReference Include="..\SushiBarDataModels\SushiBarDataModels.csproj" />
<ProjectReference Include="..\SushiBarListImplements\SushiBarListImplements.csproj" />
</ItemGroup>
<Target Name="AfterBuild">

View File

@ -4,9 +4,9 @@ using SushiBarFileImplement.Implements;
namespace SushiBarFileImplement
{
public class ListImplementationExtension : IImplementationExtension
public class FileImplementationExtension : IImplementationExtension
{
public int Priority => 0;
public int Priority => 1;
public void RegisterServices()
{
DependencyManager.Instance.RegisterType<IClientStorage, ClientStorage>();

View File

@ -9,8 +9,7 @@ namespace SushiBarFileImplement.Models
[DataContract]
public class MessageInfo : IMessageInfoModel
{
[DataMember]
public int Id { get; set; }
public int Id => throw new NotImplementedException();
[DataMember]
public string MessageId { get; set; } = string.Empty;

View File

@ -16,9 +16,7 @@
<ProjectReference Include="..\SushiBarDataModels\SushiBarDataModels.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)ImplementationExtensions\*.dll&quot;" />
<Target Name="AfterBuild">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;\SushiBar\ImplementationExtentions&quot;" />
</Target>
</Project>

View File

@ -0,0 +1,22 @@
using SushiBarContracts.StoragesContracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SushiBarListImplements.Implements
{
public class BackUpInfo : IBackUpInfo
{
public List<T>? GetList<T>() where T : class, new()
{
throw new NotImplementedException();
}
public Type? GetTypeByModelInterface(string modelInterfaceName)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,5 +1,6 @@
using SushiBarContracts.BindingModel;
using SushiBarContracts.SearchModel;
using SushiBarContracts.StoragesContracts;
using SushiBarContracts.ViewModels;
using SushiBarListImplement;
using SushiBarListImplements.Models;
@ -11,7 +12,7 @@ using System.Threading.Tasks;
namespace SushiBarListImplements.Implements
{
public class ClientStorage
public class ClientStorage : IClientStorage
{
private readonly DataListSingleton _source;
public ClientStorage()

View File

@ -0,0 +1,22 @@
using SushiBarContracts.DI;
using SushiBarContracts.StoragesContracts;
using SushiBarListImplements.Implements;
namespace SushiBarListImplements
{
public class ListImplementationExtention : IImplementationExtension
{
public int Priority => 0;
public void RegisterServices()
{
DependencyManager.Instance.RegisterType<IClientStorage, ClientStorage>();
DependencyManager.Instance.RegisterType<IComponentStorage, ComponentStorage>();
DependencyManager.Instance.RegisterType<IImplementerStorage, ImplementerStorage>();
DependencyManager.Instance.RegisterType<IMessageInfoStorage, MessageInfoStorage>();
DependencyManager.Instance.RegisterType<IOrderStorage, OrderStorage>();
DependencyManager.Instance.RegisterType<ISushiStorage, SushiStorage>();
DependencyManager.Instance.RegisterType<IBackUpInfo, BackUpInfo>();
}
}
}

View File

@ -16,4 +16,8 @@
<ProjectReference Include="..\SushiBarDataModels\SushiBarDataModels.csproj" />
</ItemGroup>
<Target Name="AfterBuild">
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;\SushiBar\ImplementationExtentions&quot;" />
</Target>
</Project>