Skip to content

Commit

Permalink
Merge pull request #9 from mahdidelzendeh72/develop
Browse files Browse the repository at this point in the history
add comment #6
  • Loading branch information
Ali-YousefiTelori authored Dec 27, 2022
2 parents 5732499 + 3dadb77 commit 827c6db
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
namespace EasyMicroservices.Serialization.BinaryGo.Providers
{
/// <summary>
///
/// use binary go package as binary serialization provider
/// </summary>
public class BinaryGoProvider : BaseBinarySerializationProvider
{
/// <summary>
///
/// Deserialize from byte
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reader"></param>
Expand All @@ -22,7 +22,7 @@ public override T Deserialize<T>(ReadOnlySpan<byte> reader)
}

/// <summary>
///
/// Serialize to byte
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace EasyMicroservices.Serialization.Newtonsoft.Json.Providers
{
/// <summary>
///
/// use NewtonsoftJson package as text serialization provider
/// </summary>
public class NewtonsoftJsonProvider : BaseTextSerializationProvider
{
/// <summary>
///
/// Deserialize from string
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
Expand All @@ -20,7 +20,7 @@ public override T Deserialize<T>(string value)
return JsonConvert.DeserializeObject<T>(value);
}
/// <summary>
///
/// Serialize to string
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
namespace EasyMicroservice.Serialization.System.Text.Json.Providers
{
/// <summary>
/// /
/// use mocrosoft SystemTextJson package as binary serialization provider
/// </summary>

public class SystemTextJsonBinaryProvider : BaseBinarySerializationProvider
{
/// <summary>
///
/// Deserialize from byte
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reader"></param>
Expand All @@ -23,7 +23,7 @@ public override T Deserialize<T>(ReadOnlySpan<byte> reader)
return JsonSerializer.Deserialize<T>(reader);
}
/// <summary>
///
/// Serialize to byte
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
namespace EasyMicroservice.Serialization.System.Text.Json.Providers
{
/// <summary>
///
/// use mocrosoft SystemTextJson package as text serialization provider
/// </summary>
public class SystemTextJsonProvider : BaseTextSerializationProvider
{
/// <summary>
///
/// </summary>
/// Deserialize from string /// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
/// <returns></returns>
Expand All @@ -22,7 +21,7 @@ public override T Deserialize<T>(string value)
return JsonSerializer.Deserialize<T>(value);
}
/// <summary>
///
/// Serialize to string
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

namespace EasyMicroservices.Serialization.Tests.Providers
{
/// <summary>
/// base class for test
/// </summary>
public abstract class BaseTextSerilizationTest
{
/// <summary>
/// text serilaze provider
/// </summary>
public ITextSerialization _provider { get; }
/// <summary>
///
/// </summary>
/// <param name="provider"></param>
public BaseTextSerilizationTest(ITextSerialization provider)
{
_provider = provider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace EasyMicroservices.Serialization.Interfaces
{
/// <summary>
///
/// general serialization method defines here
/// </summary>
public interface IBaseSerialization
{
/// <summary>
///
/// can convert check which type is supported for serialization
/// </summary>
/// <param name="objectType"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
namespace EasyMicroservices.Serialization.Interfaces
{
/// <summary>
///
/// serializa to byte and visa versa
/// </summary>
public interface IBinarySerialization : IBaseSerialization
{
/// <summary>
///
/// serializa to byte array
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
ReadOnlySpan<byte> Serialize(object value);
/// <summary>
///
/// Deserialize from byte
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reader"></param>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
namespace EasyMicroservices.Serialization.Interfaces
{
/// <summary>
///
/// serialize to string and visa versa
/// </summary>
public interface ITextSerialization : IBaseSerialization
{
/// <summary>
///
/// Serialize to string
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
string Serialize(object value);
/// <summary>
///
/// Deserialize from string
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
namespace EasyMicroservices.Serialization.Providers
{
/// <summary>
///
/// base binary implimentaion
/// </summary>
public abstract class BaseBinarySerializationProvider : BaseProvider, IBinarySerialization
{
/// <summary>
///
/// Deserialize from byte
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reader"></param>
/// <returns></returns>
public abstract T Deserialize<T>(ReadOnlySpan<byte> reader);
/// <summary>
///
/// Serialize to byte
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
namespace EasyMicroservices.Serialization.Providers
{
/// <summary>
///
/// general serialization method defines here
/// </summary>
public abstract class BaseProvider : IBaseSerialization
{
/// <summary>
///
/// can convert check which type is supported for serialization
/// </summary>
/// <param name="objectType"></param>
/// <returns></returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
namespace EasyMicroservices.Serialization.Providers
{
/// <summary>
///
/// base string implimentaion
/// </summary>
public abstract class BaseTextSerializationProvider : BaseProvider, ITextSerialization
{

/// <summary>
///
/// Deserialize from string
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public abstract T Deserialize<T>(string value);
/// <summary>
///
/// Serialize to string
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
Expand Down

0 comments on commit 827c6db

Please sign in to comment.