Out with MagicOnion, in with LiteNetLib
Removed MagicOnion Added LiteNetLib Created client and server abstractions Fixed serialization bugs
This commit is contained in:
parent
433a7b4ae4
commit
e96146b7bb
869 changed files with 59401 additions and 16812 deletions
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue