Class MultiLangResolver
An ovverride function for JsonConvert.SerializeObject() that checks FieldName attribute and takes changes on translated field name.
var settings = new JsonSerializerSettings
{
ContractResolver = new MultiLangResolver(BO4E.ENUM.Language.EN),
Formatting = Formatting.Indented
};
Inheritance
System.Object
MultiLangResolver
Namespace: BO4E.meta
Assembly: BO4Enet.dll
Syntax
public class MultiLangResolver : DefaultContractResolver
Constructors
| Improve this Doc View SourceMultiLangResolver(Language)
sending language as a parameter
Declaration
public MultiLangResolver(Language lang)
Parameters
Type | Name | Description |
---|---|---|
Language | lang |
Methods
| Improve this Doc View SourceCreateProperty(MemberInfo, MemberSerialization)
Check every field for having translated name or no
Declaration
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
Parameters
Type | Name | Description |
---|---|---|
MemberInfo | member | |
MemberSerialization | memberSerialization |
Returns
Type | Description |
---|---|
JsonProperty |