我知道使用EnableLowerCamelCase,我们可以在驼峰情况下做出响应。但是使用此属性,我们不会在camelCase中获得元数据。
在骆驼的情况下,是否还可以获取元数据?
答案 0 :(得分:-1)
StartUp.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseMvc(routeBuilder =>
{
routeBuilder.EnableDependencyInjection(); //This Is added for OData
//Added this 2 line in your Code
var builder = new ODataConventionModelBuilder();
builder.EnableLowerCamelCase();
});
}