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
1 answer

ServiceStack OnDeserialized Equivalent

I am deserialize a websocket message in real time. In the message (string of json) I receive there is a unix timestamp (long). As soon as each object is deserialized I need it to call a method ASAP so that I can capture the delay between the time…
LorneCash
  • 1,446
  • 2
  • 16
  • 30
2
votes
2 answers

How to load a CSV file created from a dictionary with entities using ServiceStack.Text

I have a Dictionary that has key: a string, value: a List of Entity, where Entity is a class: public class Entity { public string myString { get; set; } public int myInt { get; set; } } Dictionary> myDictionary = new…
2
votes
1 answer

ServiceStack JSON serializer: How can I change the default serializer globally?

I have a case where the ServiceStack JSON serializer fails to deserialize, and where Newtonsoft's JSON.NET manages to do so. I have not found a clear-cut way to replace the default serializer with JSON.NET, so its global and for all…
Ted
  • 19,727
  • 35
  • 96
  • 154
2
votes
1 answer

Could not load file or assembly Visual Studio 2019 (Community)

This is going to be one of those questions for which there are hundreds of answers, so please bare with me as I have tried most of them! I have been breaking up a very large project into smaller components with the view to slowly migrate it all to…
2
votes
2 answers

csv change order of the columns

I am currently using ServiceStack.Text to serialize CSV from a list of objects. I have a model: public class UploadDocument { [DataMember(Name = "Patient")] public string Patient { get; set; } [DataMember(Name = "Patient First Name")] public…
2
votes
1 answer

ServiceStack - Year, Month, and Day parameters describe an un-representable DateTime even using JsConfig

I have looked at multiple resources online, but whatever I try just doesn't seem to work. What am I doing wrong? using directives using ServiceStack; using ServiceStack.Text; using System; using System.Collections.Generic; using…
Tom McDonough
  • 1,176
  • 15
  • 18
2
votes
1 answer

Use TemplateContext instead of TemplateContext?

I just upgraded my project from ServiceStack 5.1 to 5.5.1. Now where I am using TemplateContext from ServiceStack.Templates it tells instead to use TemplateContext. Needless to say, this is likely a mistake in the description for the Obsolete…
arjabbar
  • 6,044
  • 4
  • 30
  • 46
2
votes
1 answer

IndexOutOfRangeException in CsvWriter

I'm getting a System.IndexOutOfRangeException while trying to serialize a dataset of dynamic objects. It's not any single row since I've tested it with each individual row (there are only four in my example). It's happening in the…
Arian Kulp
  • 831
  • 8
  • 31
2
votes
1 answer

convert object to CSV string without header Servicestack CSVSerializer

I'm using Servicestack.text CSV serializer to serialize an object into CSV format. Here is the way Im trying CsvSerializer.SerializeToString(MyObject) But it converts into CSV including the headers like this ID,Name, Age\r\n13,Alex,45 But I dont…
Sandeep Thomas
  • 4,303
  • 14
  • 61
  • 132
2
votes
1 answer

MissingMethodException Global.asax.cs

Because of this blog-post: https://www.radenkozec.com/8-ways-improve-asp-net-web-api-performance/ I´ve tried to replace JSON.net with ServiceStack.Text as JSON-Serializer in my WebApi. With this…
2
votes
1 answer

How to prevent a JsConfig scope from affecting global settings

In AppHost.Configure I set a global JSON config JsConfig.TreatEnumAsInteger = false; and have a simple handler with two GET endpoints public object Get(GetDayOfWeekAsText request) { return new GetDayOfWeekResponse(); } public object…
David
  • 1,143
  • 7
  • 9
2
votes
1 answer

How to deserialize nullable enum with EnumMember attribute in ServiceStack.Text?

This is a follow up question to my these two earlier questions about ServiceStack.Text: first, second. As seen by checking answers to those questions, it is possible to serialize and deserialize enums based on their data contract's and EnumMember…
2
votes
1 answer

How to configure ServiceStack.Text to use EnumMember when serializing to csv or jsv?

This is a follow up question to my earlier question about ServiceStack.Text and deserializing json to .Net enums. The answer to that question resolves how to get ServiceStack.Text to use .Net DataContract and EnumMember to map strings to enum…
2
votes
2 answers

ServiceStack Output XML format - xml attribute

I am using ServiceStack and need to render XML in specific format. Here is my POCO class [DataContract] public class LookupModelBase { [XmlAttribute, DataMember] public int Id { get; set; } [XmlText, DataMember] public string Label…
Mehmet Otkun
  • 1,374
  • 9
  • 22
2
votes
1 answer

Can't convert CSV to Poco

I'm trying to read a CSV file sent from an upload form and convert it to my Poco. Here is my test file: "30247685204","PWITA1","114000/2017/SE","","27/11/2017","1027/00","","","ZZPWI1","INTER…
pardie
  • 399
  • 2
  • 16
1 2
3
14 15