initial commit

This commit is contained in:
2026-07-21 14:28:43 +07:00
commit 01107db6fd
995 changed files with 75124 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
using Indotalent.Data.Entities;
using Indotalent.Shared.Consts;
using Microsoft.AspNetCore.OData;
using Microsoft.OData.Edm;
using Microsoft.OData.ModelBuilder;
namespace Indotalent.Infrastructure.OData;
public static class DI
{
public static IServiceCollection AddODataService(this IServiceCollection services)
{
services.AddControllers().AddOData(options =>
{
options.AddRouteComponents("odata", GetEdmModel())
.Select()
.Filter()
.OrderBy()
.Expand()
.Count()
.SetMaxTop(GlobalConsts.ODataMaxTop);
});
return services;
}
private static IEdmModel GetEdmModel()
{
var builder = new ODataConventionModelBuilder();
builder.EntitySet<SerilogLogs>("SerilogLogs");
return builder.GetEdmModel();
}
}