Hi, I'm studying, Nancy, and I'm trying to get attached to the model, but I get an error message:
Error 8 'NancyFxTutorial.CarModule' does not contain a definition for 'Bind' and no extension method 'Bind' accepting a first argument of type 'NancyFxTutorial.CarModule' could be found (are you missing a using directive or an assembly reference?) C:\Development\Projects\C
Model:
public class BrowseCarQuery { public string Make { get; set; } public string Model { get; set; } } public class CarModule : NancyModule { public CarModule() { Get["/status"] = _ => "Hello World"; Get["/Car/{id}"] = parameters => { int id = parameters.id; return Negotiate.WithStatusCode(HttpStatusCode.OK).WithModel(id); }; Get["/{make}/{model}"] = parameters => { BrowseCarQuery model = new BrowseCarQuery(); var carQuery = this.Bind<>() }; } } _ => "Hello World"; public class BrowseCarQuery { public string Make { get; set; } public string Model { get; set; } } public class CarModule : NancyModule { public CarModule() { Get["/status"] = _ => "Hello World"; Get["/Car/{id}"] = parameters => { int id = parameters.id; return Negotiate.WithStatusCode(HttpStatusCode.OK).WithModel(id); }; Get["/{make}/{model}"] = parameters => { BrowseCarQuery model = new BrowseCarQuery(); var carQuery = this.Bind<>() }; } } ); public class BrowseCarQuery { public string Make { get; set; } public string Model { get; set; } } public class CarModule : NancyModule { public CarModule() { Get["/status"] = _ => "Hello World"; Get["/Car/{id}"] = parameters => { int id = parameters.id; return Negotiate.WithStatusCode(HttpStatusCode.OK).WithModel(id); }; Get["/{make}/{model}"] = parameters => { BrowseCarQuery model = new BrowseCarQuery(); var carQuery = this.Bind<>() }; } } {model}"] = parameters => public class BrowseCarQuery { public string Make { get; set; } public string Model { get; set; } } public class CarModule : NancyModule { public CarModule() { Get["/status"] = _ => "Hello World"; Get["/Car/{id}"] = parameters => { int id = parameters.id; return Negotiate.WithStatusCode(HttpStatusCode.OK).WithModel(id); }; Get["/{make}/{model}"] = parameters => { BrowseCarQuery model = new BrowseCarQuery(); var carQuery = this.Bind<>() }; } }
Any tips?
Thank you in advance
source share