Questions tagged [servicestack-text]

ServiceStack.Text is an independent, dependency-free serialization library that contains ServiceStack's text processing functionality

ServiceStack.Text is an independent, dependency-free serialization library that contains ServiceStack's text processing functionality, including:

  • List item
  • JsonSerializer
  • TypeSerializer (JSV-Format)
  • CsvSerializer
  • T.Dump extension method
  • StringExtensions - Xml/Json/Csv/Url encoding, BaseConvert, Rot13, Hex escape, etc.
  • Stream, Reflection, List, DateTime, etc extensions and utils.
212 questions
2
votes
3 answers

Serializing a list of dynamic objects to a CSV with ServiceStack.Text

All of my EF classes have a Projection() method that helps me choose what I want to project from the class to the SQL queries: Example: public static Expression> Projection() { return e => new { …
sports
  • 7,851
  • 14
  • 72
  • 129
2
votes
1 answer

Deserializing JSON with leading @ chars in servicestack

The below snippet replicates a deserialisation issue I'm having inside a ServiceStack application. On running the below, the consignee property is populated correctly but the id is not. static void Main (string[] args) { string…
Donogst
  • 228
  • 2
  • 8
2
votes
1 answer

CSV Serialization of inherited types

I am attempting to serialise some records into CSV using the ServiceStack.Text library. I am using inheritance, specifically abstract classes and the properties on the child types are not being output. Yes I know this is a bad idea but as I have no…
2
votes
1 answer

Serializing CustomUserSession in ServiceStack

We're trying to use Redis ICacheClient with a CustomUserSession, but our custom properties are not stored. The problem seems to be in the json created by serializer. Here a test: public class CustomUserSession : AuthUserSession { public string…
Ivan Fioravanti
  • 848
  • 7
  • 20
2
votes
0 answers

NHibernate Mapping: Insert Children after Parent has ID from INSERT Trigger without UPDATE of a child' ParentId

Let me please explain our situation first. We are working on a brown field application. There is a given database structure we can't change like this example: Table1 [ID] [Field1] [Field2] [Field3] ... Table2 [ID] [Table1_ID] [FieldA] [FieldB]…
MVCible
  • 391
  • 3
  • 14
2
votes
0 answers

ServiceStack.Text doesn't install in Windows Phone 8 project through Nuget

Can't install ServiceStack.Text package using nuget in a Windows Phone 8 project. The message I get is Could not install package 'ServiceStack.Text 4.0.5'. You are trying to install this package > into a project that targets…
nonelse
  • 23
  • 5
2
votes
1 answer

How do I return an empty JSON object for methods of return type void?

Requirement: I am looking for a way to return an empty JSON object (such as {}) when the return type of my ServiceStack service method is void. Reasoning: The reason for wanting to return an empty JSON object for void types is due to the way jQuery…
Scott
  • 21,211
  • 8
  • 65
  • 72
2
votes
1 answer

ServiceStack Jsv serializer fails to deserialize Dictionary

I'm using OrmLite and one of my entities has property of type Dictionary of DateTime and int and it fails to deserialize that property. I found out that this is Jsv serializer problem. I have failing test: [Test] public void…
Andrej Slivko
  • 1,236
  • 2
  • 12
  • 27
2
votes
1 answer

Servicestack JSV empty string deserialized as null

It seems that JSV deserializes an empty string as null. The following test fails for JSV but passes for JSON. class Foo { public string String { get; set; } } [TestFixture] public class TestJsvEmptyString { …
2
votes
0 answers

why does ServiceStack.Text not use ModelFactory for lists?

I think I found a bug in ServiceStack.Text. I added this test (below) to the CustomSerializerTests file. You'll notice that it works for deserializing a single item, but the constructor is not called when deserializing the (i)list. (Changing from…
Brannon
  • 5,324
  • 4
  • 35
  • 83
2
votes
1 answer

ServiceStack.Text and Twitter JSON

I am attempting to deserialize the twitter RateLimit Json with ServiceStack.Text. I created an appropriate DTO object (look at the bottom of the post) for the JSON getting pulled down. I made use of System.Runtime.Serialization to rename the…
Pete Garafano
  • 4,863
  • 1
  • 23
  • 40
2
votes
1 answer

Using StackService.Text and JSON for lists of objects

Any help will be appreciated here. I'm trying to use StackService. Text and JSON in order to get a list of objects, that each object contains a list. Here is the definition of the classes: [DataContract] public class GroupingList { …
Elad Gutman
  • 189
  • 1
  • 12
2
votes
3 answers

System.TimeZoneNotFoundException on ViewPage using ServiceStack.Razor

I have created a view using Servicestack.Razor. On the view page I am trying to get the session using following code. var session = GetSession().ToJson(); When I put this code on the view page, I get following…
Bhushan Firake
  • 9,338
  • 5
  • 44
  • 79
2
votes
1 answer

JsConfig.ExcludePropertyNames example, not working for me

Trying to exclude properties from a model from being included during serialization. I am using the following syntax: JsConfig.ExcludePropertyNames = new[] { "ShortDescription" }; Just after that I have the following: return…
Val
  • 1,023
  • 3
  • 10
  • 21
2
votes
1 answer

Deserialize XML with UTF-16 encoding in ServiceStack.Text

I am trying to use ServiceStack.Text to deserialize some XML. Code: var buildEvent = dto.EventXml.FromXml(); The opening xml line is: ServiceStack fails with the following error: The…