after some research i was found that my problem was about using swagger along with OData in .NetCore2.1.
i found a solution for this problem.
first i added two following Nuget packages:
Swashbuckle.AspNetCore
Swashbuckle.AspNetCore.Annotations
then, i added following codes in Startup.cs
services.AddMvc(options => {
foreach (var outputFormatter in
options.OutputFormatters.OfType<ODataOutputFormatter>().Where(_ =>
_.SupportedMediaTypes.Count == 0))
{
outputFormatter.SupportedMediaTypes.Add(new
MediaTypeHeaderValue("application/prs.odatatestxx-odata"));
}
foreach (var inputFormatter in
options.InputFormatters.OfType<ODataInputFormatter>().Where(_ =>
_.SupportedMediaTypes.Count == 0))
{
inputFormatter.SupportedMediaTypes.Add(new
MediaTypeHeaderValue("application/prs.odatatestxx-odata"));
}
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
the, i added following code line in controllers:
[ApiExplorerSettings(IgnoreApi = false)]
please note that it was worked for me but it may be need more research for eventually side effects