37 lines
1000 B
C#
37 lines
1000 B
C#
// /**
|
|
// * File: JSONIdentityMapping.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using System;
|
|
using ln.json.mapping;
|
|
using ln.identities;
|
|
using ln.json;
|
|
|
|
namespace ln.application.json
|
|
{
|
|
public class JSONIdentityMapping : JSONMapping
|
|
{
|
|
public JSONIdentityMapping()
|
|
:base(typeof(Identity))
|
|
{
|
|
}
|
|
|
|
public override object FromJson(JSONMapper mapper, JSONValue json) => throw new NotSupportedException();
|
|
public override JSONValue ToJson(JSONMapper mapper, object value)
|
|
{
|
|
Identity identity = value as Identity;
|
|
|
|
JSONObject jidentity = new JSONObject();
|
|
jidentity.Add("UniqueID", identity.UniqueID);
|
|
jidentity.Add("IdentityName", identity.IdentityName);
|
|
|
|
return jidentity;
|
|
}
|
|
}
|
|
}
|