Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add ability to register custom DTO's for AOT so that Monotouch doesn't crash #135

Merged
merged 1 commit into from

2 participants

@pseabury

No description provided.

@mythz mythz merged commit 173618f into ServiceStack:master
@mythz
Owner

Awesome, is it also possible to contribute the latest MonoTouch dlls with this to the release MonoTouch directory?
https://github.com/ServiceStack/ServiceStack/tree/master/release/latest/MonoTouch

@pseabury
@mythz
Owner

Sweet, Can you do a quick pull of ServiceStack.Text then give it a v3.85 version number.
Thanks!

@pseabury
@pseabury
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 9, 2012
  1. @pseabury
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/ServiceStack.Text/JsConfig.cs
View
23 src/ServiceStack.Text/JsConfig.cs
@@ -207,6 +207,29 @@ public static void RegisterForAot()
RegisterCsvSerializer();
}
+ [MonoTouch.Foundation.Preserve]
+ public static bool RegisterTypeForAot<T>()
+ {
+ bool ret = false;
+ try
+ {
+ JsonAotConfig.Register<T>();
+
+ int i = 0;
+ if(JsvWriter<T>.WriteFn() != null && JsvReader<T>.GetParseFn() != null) i++;
+ if(JsonWriter<T>.WriteFn() != null && JsonReader<T>.GetParseFn() != null) i++;
+ if(QueryStringWriter<Poco>.WriteFn() != null) i++;
+
+ CsvSerializer<T>.WriteFn();
+ CsvSerializer<T>.WriteObject(null, null);
+ CsvWriter<T>.WriteObject(null, null);
+ CsvWriter<T>.WriteObjectRow(null, null);
+ ret = true;
+ }catch(Exception){}
+
+ return ret;
+ }
+
[MonoTouch.Foundation.Preserve]
static void RegisterQueryStringWriter()
{
Something went wrong with that request. Please try again.