File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
AspNet/OData/SomeOpenApiODataWebApiExample
AspNetCore/OData/SomeODataOpenApiExample Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
namespace ApiVersioning . Examples ;
2
2
3
+ using Microsoft . AspNet . OData . Query ;
4
+
5
+ // TODO: Model Bound settings can be performed via attributes if the
6
+ // return type is known to the API Explorer or can be explicitly done
7
+ // via one or more IModelConfiguration implementations
8
+
3
9
/// <summary>
4
10
/// Represents a book.
5
11
/// </summary>
12
+ [ Filter ( "author" , "published" ) ]
6
13
public class Book
7
14
{
8
15
/// <summary>
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ public void Configuration( IAppBuilder builder )
68
68
. Allow ( Skip | Count )
69
69
. AllowTop ( 100 )
70
70
. AllowOrderBy ( "title" , "published" ) ;
71
+
72
+ // applies model bound settings implicitly using an ad hoc EDM. alternatively, you can create your own
73
+ // IModelConfiguration + IODataQueryOptionsConvention for full control over what goes in the ad hoc EDM.
74
+ options . AdHocModelBuilder . ModelConfigurations . Add ( new ImplicitModelBoundSettingsConvention ( ) ) ;
71
75
} ) ;
72
76
73
77
configuration . EnableSwagger (
Original file line number Diff line number Diff line change 1
1
namespace ApiVersioning . Examples ;
2
2
3
+ using Microsoft . OData . ModelBuilder ;
4
+
5
+ // TODO: Model Bound settings can be performed via attributes if the
6
+ // return type is known to the API Explorer or can be explicitly done
7
+ // via one or more IModelConfiguration implementations
8
+
3
9
/// <summary>
4
10
/// Represents a book.
5
11
/// </summary>
12
+ [ Filter ( "author" , "published" ) ]
6
13
public class Book
7
14
{
8
15
/// <summary>
You can’t perform that action at this time.
0 commit comments