Skip to content

Instantly share code, notes, and snippets.

@CallumVass
Created November 9, 2013 22:52
Show Gist options
  • Save CallumVass/7391124 to your computer and use it in GitHub Desktop.
Save CallumVass/7391124 to your computer and use it in GitHub Desktop.
Error with Oak and Nancy Insert
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
container.Register(new Customers());
}
}
public class Customers : DynamicRepository
{
}
public class CustomerModule : ApiModule
{
public CustomerModule(Customers customers)
: base("/customers")
{
// This is fine, returns data
Get["/"] = _ => customers.All();
// Returns error: Can't parse this object to the database - there are no properties set
Post["/"] = _ =>
{
var c = this.Bind();
return customers.Insert(c);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment