Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPOSERS: Interface changes to support type restrictions for STRING, BYTE[], STREAM #13

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions STX.Serialization.Providers.Abstractions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "STX.Serialization.Providers.Abstractions", "STX.Serialization.Providers.Abstractions\STX.Serialization.Providers.Abstractions.csproj", "{38A8052D-3C6E-44DC-ACEB-AA28881C5CD5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "STX.Serialization.Providers.Abstractions", "STX.Serialization.Providers.Abstractions\STX.Serialization.Providers.Abstractions.csproj", "{38A8052D-3C6E-44DC-ACEB-AA28881C5CD5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "STX.Serialization.Providers.Abstractions.Infrastructure.Build", "STX.Serialization.Providers.Abstractions.Infrastructure.Build\STX.Serialization.Providers.Abstractions.Infrastructure.Build.csproj", "{D47D1D45-BD43-4735-BFB5-83296B2941A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "STX.Serialization.Providers.Abstractions.Tests.Acceptance", "STX.Serialization.Providers.Abstractions.Tests.Acceptance\STX.Serialization.Providers.Abstractions.Tests.Acceptance.csproj", "{A3E3CBE6-74E2-4196-94E1-F4238C36639E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "STX.Serialization.Providers.Abstractions.Tests.Unit", "STX.Serialization.Providers.Abstractions.Tests.Unit\STX.Serialization.Providers.Abstractions.Tests.Unit.csproj", "{270ECD52-7950-448E-BA0B-55C6A30117FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,14 +21,6 @@ Global
{D47D1D45-BD43-4735-BFB5-83296B2941A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D47D1D45-BD43-4735-BFB5-83296B2941A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D47D1D45-BD43-4735-BFB5-83296B2941A5}.Release|Any CPU.Build.0 = Release|Any CPU
{A3E3CBE6-74E2-4196-94E1-F4238C36639E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3E3CBE6-74E2-4196-94E1-F4238C36639E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3E3CBE6-74E2-4196-94E1-F4238C36639E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3E3CBE6-74E2-4196-94E1-F4238C36639E}.Release|Any CPU.Build.0 = Release|Any CPU
{270ECD52-7950-448E-BA0B-55C6A30117FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{270ECD52-7950-448E-BA0B-55C6A30117FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{270ECD52-7950-448E-BA0B-55C6A30117FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{270ECD52-7950-448E-BA0B-55C6A30117FD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

using System.Threading.Tasks;

namespace STX.Serialization.Providers.Abstractions
{
public interface ISerializationAbstractionProvider
{
ValueTask<string> Serialize<T>(T @object);
ValueTask<T> Deserialize<T>(string json);
}
public interface ISerializationAbstractionProvider : ISerializationOperations
{ }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

using System.IO;
using System.Threading.Tasks;
using STX.Serialization.Providers.Abstractions.Models;

namespace STX.Serialization.Providers.Abstractions
{
public interface ISerializationOperations
{
ValueTask<TOutput> Serialize<TInput, TOutput>(TInput @object)
where TOutput : IDataRepresentation<string>, IDataRepresentation<byte[]>, IDataRepresentation<Stream>;

ValueTask<TOutput> Deserialize<TInput, TOutput>(TInput json)
where TInput : IDataRepresentation<string>, IDataRepresentation<byte[]>, IDataRepresentation<Stream>;
}
}
11 changes: 11 additions & 0 deletions STX.Serialization.Providers.Abstractions/Models/ByteArrayData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

namespace STX.Serialization.Providers.Abstractions.Models
{
public class ByteArrayData : IDataRepresentation<byte[]>
{
public byte[] Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

namespace STX.Serialization.Providers.Abstractions.Models
{
public interface IDataRepresentation<T>
{
T Value { get; set; }
}
}
13 changes: 13 additions & 0 deletions STX.Serialization.Providers.Abstractions/Models/StreamData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

using System.IO;

namespace STX.Serialization.Providers.Abstractions.Models
{
public class StreamData : IDataRepresentation<Stream>
{
public Stream Value { get; set; }
}
}
11 changes: 11 additions & 0 deletions STX.Serialization.Providers.Abstractions/Models/StringData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ----------------------------------------------------------------------------------
// Copyright (c) The Standard Organization: A coalition of the Good-Hearted Engineers
// ----------------------------------------------------------------------------------

namespace STX.Serialization.Providers.Abstractions.Models
{
public class StringData : IDataRepresentation<string>
{
public string Value { get; set; }
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading