When I try to run the All().ToList method (as in db.MyTable.All().ToList) I get a MethodMissingException, stating;
"No parameterless constructor defined for this object."
Here's the stack trace if you need it.
at Simple.Data.SimpleRecord.TryConvert(ConvertBinder binder, Object& result)
at CallSite.Target(Closure , CallSite , Object )
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at AbbeSays.Web.Repositories.FamilyRepository.GetFamilies() in C:\Dev\AbbeSays\AbbeSays.Web\Repositories\FamilyRepository.cs:line 19
at AbbeSays.Web.MainModule.<>c__DisplayClass2.<.ctor>b__0(Object _) in C:\Dev\AbbeSays\AbbeSays.Web\MainModule.cs:line 10
at Nancy.Routing.Route.Invoke(DynamicDictionary parameters)
at Nancy.NancyEngine.ResolveAndInvokeRoute(NancyContext context)
at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, IPipelines pipelines)
Hmmm - no this is something else...
It's actually my object it's complaining on. But it has no constructors, hence a parameterless, default one I presume. (have tried to implement a parameterless one as well - no good).
Have I got this wrong?
Yes - it was my fault. Sorry - I put in a complete dynamic object in a field.
It works great. And now you get another issue resolved. For free :)
But but ... I had NO constructor. And then a parameterless one...
Don't get that - but hey it works. My bad
This is happening for me too. I added a default ctor to my type but it doesn't make a difference.
Interestingly enough, it works absolutely fine for another type (which has a default ctor).
Marcus, what change did you make to get this to work?
I'm using the Mongo adapter
@joshilewis hmmm - hard to track back after my changes ...
But as I remember from my comment above I think the problem actually was solved by correcting a stupid misstake by me, where I did a FindById() using a SimpleDataRecord instead of the Id property of the object.
So if anything the error message threw me off.
Sorry that I couldn't be of any more mail.