Skip to content

Allow sharing datamodel classes between client and serverΒ #47

@asierpn

Description

@asierpn

We have started to share datamodel classes between server and client in our project, but to make it work I had to change this method in the ServiceSerializer class because the Version column on the client side is now of type byte[] like on the server side:

        public static string GetVersion(JObject instance)
        {
            foreach (JProperty property in instance.Properties())
            {
                if (string.Equals(property.Name, SystemProperties.JsonVersionProperty, StringComparison.OrdinalIgnoreCase))
                {
                    return JsonConvert.SerializeObject(instance.Value<byte[]>(property.Name)).Replace("\"", "");
                }
            }
            return null;
        }

It would be great if the new version of the library allowed this, so that the same classes could be reused between server and client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientImprovements or additions to the client code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions