File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
AspNetCore/OData/SomeODataOpenApiExample
AspNet/OData/SomeOpenApiODataWebApiExample Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
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+
39/// <summary>
410/// Represents a book.
511/// </summary>
12+ [ Filter ( "author" , "published" ) ]
613public class Book
714{
815 /// <summary>
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ public void Configuration( IAppBuilder builder )
6868 . Allow ( Skip | Count )
6969 . AllowTop ( 100 )
7070 . 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 ( ) ) ;
7175 } ) ;
7276
7377 configuration . EnableSwagger (
Original file line number Diff line number Diff line change 11namespace ApiVersioning . Examples ;
22
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+
39/// <summary>
410/// Represents a book.
511/// </summary>
12+ [ Filter ( "author" , "published" ) ]
613public class Book
714{
815 /// <summary>
You can’t perform that action at this time.
0 commit comments