Out with MagicOnion, in with LiteNetLib

Removed MagicOnion
Added LiteNetLib
Created client and server abstractions
Fixed serialization bugs
This commit is contained in:
hyperion51 2020-03-24 14:36:22 +00:00
commit e96146b7bb
869 changed files with 59401 additions and 16812 deletions

View file

@ -0,0 +1,32 @@
using System.Reflection;
using RethinkDb.Driver.Net;
using Newtonsoft.Json.Serialization;
namespace RethinkDb.Driver.Utils
{
/// <summary>
/// Provides methods that assist in the translation of linq queries.
/// </summary>
public static class QueryHelper
{
/// <summary>
/// Gets the name of the database field that corresponds to the given class member.
/// The mapping can be configured by setting <see cref="Converter.Serializer"/> to a custom Serializer.
/// </summary>
public static string GetJsonMemberName(MemberInfo member)
{
if ( !(Converter.Serializer?.ContractResolver is DefaultContractResolver contractResolver) )
{
return member.Name;
}
var namingStrategy = contractResolver.NamingStrategy;
if ( namingStrategy == null )
{
return member.Name;
}
return namingStrategy.GetPropertyName( member.Name, false );
}
}
}