Skip to content

Commit

Permalink
OData.EFCore sample - add books controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfabian committed Mar 3, 2023
1 parent 2dddc14 commit b0b6603
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static void RegisterRepositories(ContainerBuilder builder)
.InstancePerLifetimeScope();

builder.RegisterType<BooksRepository>()
.AsSelf()
.As<IRepository<Book>, IReadOnlyRepository<Book>>()
.InstancePerLifetimeScope();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<ItemGroup>
<Compile Remove="Controllers\AuthorsController.cs" />
<Compile Remove="Controllers\BooksController.cs" />
<Compile Remove="Controllers\PublishersController.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected override ODataModelBuilder OnCreateEdmModel(ODataModelBuilder oDataMod
oDataModelBuilder.Namespace = "Example";

oDataModelBuilder.AddPluralizedEntitySet<Product>();
oDataModelBuilder.AddPluralizedEntitySet<Book>();

return oDataModelBuilder;
}
Expand Down

0 comments on commit b0b6603

Please sign in to comment.