From b0b6603d14c57020e6363829afcb3204f6603b5e Mon Sep 17 00:00:00 2001 From: Tomas Fabian Date: Fri, 3 Mar 2023 21:28:23 +0100 Subject: [PATCH] OData.EFCore sample - add books controller --- .../AutofacModules/ProductsAutofacModule.cs | 2 +- .../Controllers/BooksController.cs | 1 + .../SelfHostedODataService.EFCore.csproj | 1 - .../OData/SelfHostedODataService.EFCore/StartupBaseWithOData.cs | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Samples/OData/SelfHostedODataService.EFCore/AutofacModules/ProductsAutofacModule.cs b/Samples/OData/SelfHostedODataService.EFCore/AutofacModules/ProductsAutofacModule.cs index c938b48d..25a4d016 100644 --- a/Samples/OData/SelfHostedODataService.EFCore/AutofacModules/ProductsAutofacModule.cs +++ b/Samples/OData/SelfHostedODataService.EFCore/AutofacModules/ProductsAutofacModule.cs @@ -64,7 +64,7 @@ private static void RegisterRepositories(ContainerBuilder builder) .InstancePerLifetimeScope(); builder.RegisterType() - .AsSelf() + .As, IReadOnlyRepository>() .InstancePerLifetimeScope(); } } diff --git a/Samples/OData/SelfHostedODataService.EFCore/Controllers/BooksController.cs b/Samples/OData/SelfHostedODataService.EFCore/Controllers/BooksController.cs index d6595bb8..cab18c2c 100644 --- a/Samples/OData/SelfHostedODataService.EFCore/Controllers/BooksController.cs +++ b/Samples/OData/SelfHostedODataService.EFCore/Controllers/BooksController.cs @@ -1,6 +1,7 @@ using System; using Joker.Contracts.Data; using Joker.OData.Controllers; +using Sample.DataCore.EFCore; using Sample.Domain.Models; namespace SelfHostedODataService.EFCore.Controllers diff --git a/Samples/OData/SelfHostedODataService.EFCore/SelfHostedODataService.EFCore.csproj b/Samples/OData/SelfHostedODataService.EFCore/SelfHostedODataService.EFCore.csproj index 4ecfb403..3519b5b0 100644 --- a/Samples/OData/SelfHostedODataService.EFCore/SelfHostedODataService.EFCore.csproj +++ b/Samples/OData/SelfHostedODataService.EFCore/SelfHostedODataService.EFCore.csproj @@ -12,7 +12,6 @@ - diff --git a/Samples/OData/SelfHostedODataService.EFCore/StartupBaseWithOData.cs b/Samples/OData/SelfHostedODataService.EFCore/StartupBaseWithOData.cs index b2d75173..6a1b3337 100644 --- a/Samples/OData/SelfHostedODataService.EFCore/StartupBaseWithOData.cs +++ b/Samples/OData/SelfHostedODataService.EFCore/StartupBaseWithOData.cs @@ -38,6 +38,7 @@ protected override ODataModelBuilder OnCreateEdmModel(ODataModelBuilder oDataMod oDataModelBuilder.Namespace = "Example"; oDataModelBuilder.AddPluralizedEntitySet(); + oDataModelBuilder.AddPluralizedEntitySet(); return oDataModelBuilder; }