Created
November 9, 2013 22:52
-
-
Save CallumVass/7391124 to your computer and use it in GitHub Desktop.
Error with Oak and Nancy Insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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