hi, i just created a new project adding the daily build packages from myget.
i created a web api controller, using entities created from reverse engineering a db using ef power tools.
this it the code in the apicontroller
private attivitaContext db = new attivitaContext();
// GET api/cliente
[Queryable]
public IQueryable<Cliente> Get()
{
db.Configuration.LazyLoadingEnabled = false;
return db.Clienti;
}
if i calli api/cliente it works fine, when i add paramters as
http://localhost:26995/api/cliente?$filter=Attivo eq true&$orderby=Descrizione
i receive this error
{"Message":"An error has occurred.","ExceptionMessage":"The type 'WebIntf.Models.Cliente' cannot be configured as a ComplexType. It was previously configured as an EntityType.\r\nParameter name: type","ExceptionType":"System.ArgumentException","StackTrace":" at System.Web.Http.OData.Builder.ODataModelBuilder.AddComplexType(Type type)\r\n at System.Web.Http.OData.Builder.ODataConventionModelBuilder.AddComplexType(Type type)\r\n at System.Web.Http.OData.Builder.StructuralTypeConfiguration.AddComplexProperty(PropertyInfo propertyInfo)\r\n at System.Web.Http.OData.Builder.ODataConventionModelBuilder.MapComplexType(IComplexTypeConfiguration complexType)\r\n at System.Web.Http.OData.Builder.ODataConventionModelBuilder.AddComplexType(Type type)\r\n at System.Web.Http.OData.Builder.ODataConventionModelBuilder.RediscoverComplexTypes(IEnumerable
1 explicitlyAddedTypes)\r\n at System.Web.Http.OData.Builder.ODataConventionModelBuilder.GetEdmModel()\r\n at System.Web.Http.HttpActionDescriptorExtensions.<>c__DisplayClass1.b__0(Object _)\r\n at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func
2 valueFactory)\r\n at System.Web.Http.HttpActionDescriptorExtensions.GetEdmModel(HttpActionDescriptor actionDescriptor, Type entityClrType)\r\n at System.Web.Http.QueryableAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)\r\n at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<>c__DisplayClass2.b__0(HttpResponseMessage response)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass412.b__40(Task
1 t)\r\n at System.Threading.Tasks.TaskHelpersExtensions.ThenImpl[TTask,TOuterResult](TTask task, Func2 continuation, CancellationToken cancellationToken, Boolean runSynchronously)"}
how can i fix?