system.version

Why System.Version in JSON string does not deserialize correctly?

心已入冬 提交于 2019-12-10 01:14:22
问题 Context: I need to pass an object containing a large number of properties/fields (to UI Layer from Middle Tier Layer). Among this list of properties, one is of type Version which is not getting deserialized correctly from JSON string format. I have a chosen JSON format over XML as JSON serialization to string will return short string result. Problem: System.Version does not get deserialized correctly. I have tried two different .NET Libraries. Following are the code snippets for each: Code

Datatype for System.Version in sql server

僤鯓⒐⒋嵵緔 提交于 2019-12-09 04:18:34
问题 What is the best way to store System.Version in SQL Server? When I use varchar type, result of order by asc is: 1.0.0.0 11.0.0.0 12.0.0.0 2.0.0.0 回答1: you can use a varchar column you could order like this SELECT * FROM t_version ORDER BY CAST('/' + vid + '/' AS HIERARCHYID) SQL fiddle is not working today , other wise I could have showed a demo Please run this for testing SELECT * FROM ( VALUES ( '1.0.0.0' ), ( '11.0.0.0' ), ('12.0.0.0'), ('2.0.0.0') ) AS vid ( vid ) ORDER BY CAST('/' + vid

Why System.Version in JSON string does not deserialize correctly?

本小妞迷上赌 提交于 2019-12-04 22:41:48
Context: I need to pass an object containing a large number of properties/fields (to UI Layer from Middle Tier Layer). Among this list of properties, one is of type Version which is not getting deserialized correctly from JSON string format. I have a chosen JSON format over XML as JSON serialization to string will return short string result. Problem: System.Version does not get deserialized correctly. I have tried two different .NET Libraries. Following are the code snippets for each: Code Snippet 1 using ServiceStack .NET library : var version = new Version(1, 2, 3, 0); string reportJSON =

Datatype for System.Version in sql server

眉间皱痕 提交于 2019-12-02 22:17:26
What is the best way to store System.Version in SQL Server? When I use varchar type, result of order by asc is: 1.0.0.0 11.0.0.0 12.0.0.0 2.0.0.0 you can use a varchar column you could order like this SELECT * FROM t_version ORDER BY CAST('/' + vid + '/' AS HIERARCHYID) SQL fiddle is not working today , other wise I could have showed a demo Please run this for testing SELECT * FROM ( VALUES ( '1.0.0.0' ), ( '11.0.0.0' ), ('12.0.0.0'), ('2.0.0.0') ) AS vid ( vid ) ORDER BY CAST('/' + vid + '/' AS HIERARCHYID) Just store it as a normal varchar, which is good for versions up to 4 parts using