Collections - Silverlight (CLOSED)

Oct 30, 2013 at 9:00 AM
Hi,

I am having problems storing object(s) with generic collection field into NDatabase.

The documentation says:
"Circular references, immutable types, Exception class, collections, arrays, nullable types, primitive types and any custom type, all are supported by NDatabase."
So I was assuming "collections" means generics as well...

I'm using NDatabase 3.4 silverlight version (windows phone). My classes (simplified) are like this:
public class Airport
{
  public string ICAOCode;
  public List<Runway> Runways;

  public Airport()
  {
     this.ICAOCode = "";
     this.Runways = new List<Runway>();
   }
}

public class Runway
{
   public int Heading;
   public int Length;
   ......
}
All the fields in these classes are public and initialized at constructor, so there's no null values.
When I am trying to save an Airport object like this:
using (var odb = OdbFactory.Open(mDbName))
{
  odb.Store(myairportobject);
 }
the odb.Store throws an exception:
{NDatabase.Exceptions.OdbRuntimeException: 
NDatabase has thrown an Exception
Error:10:Internal error : getObjectInfoInternal  ---> System.FieldAccessException: Attempt by method 'NDatabase.Odb.Core.Layers.Layer1.Introspector.ObjectIntrospector.GetObjectInfoInternal(NDatabase.Odb.Core.Layers.Layer2.Meta.AbstractObjectInfo, System.Object, NDatabase.Odb.Core.Layers.Layer2.Meta.ClassInfo, Boolean, System.Collections.Generic.IDictionary`2<System.Object,NDatabase.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo>, NDatabase.Odb.Core.Layers.Layer1.Introspector.IIntrospectionCallback)' to access field 'System.Collections.Generic.List`1<System.__Canon>._items' failed.
I appreciate any help.
Coordinator
Nov 1, 2013 at 7:22 AM
Hello,
list is not matching the limits for Silverlight. Take a look on page: http://docs.ndatabase.net/index.html?silverlight_and_windows_phone_limit.html.
Nov 1, 2013 at 8:29 AM
Hello,

Well, I guess I just crawl back to my cave and continue with Linq2sql. Its a pity, really. NDatabase would've saved a huge amount of work.
Thanks anyway.