{"id":16567016,"url":"https://github.com/jacobjmarks/typeextensionprojectiondemo","last_synced_at":"2026-04-16T21:01:52.429Z","repository":{"id":47258430,"uuid":"402752456","full_name":"jacobjmarks/TypeExtensionProjectionDemo","owner":"jacobjmarks","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-28T02:45:48.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T23:42:42.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobjmarks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-03T11:51:03.000Z","updated_at":"2021-10-28T02:45:51.000Z","dependencies_parsed_at":"2022-09-13T10:11:55.522Z","dependency_job_id":null,"html_url":"https://github.com/jacobjmarks/TypeExtensionProjectionDemo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobjmarks%2FTypeExtensionProjectionDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobjmarks%2FTypeExtensionProjectionDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobjmarks%2FTypeExtensionProjectionDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobjmarks%2FTypeExtensionProjectionDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobjmarks","download_url":"https://codeload.github.com/jacobjmarks/TypeExtensionProjectionDemo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242008786,"owners_count":20056963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T21:05:22.285Z","updated_at":"2026-04-16T21:01:50.839Z","avatar_url":"https://github.com/jacobjmarks.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stub application for [Issue 4183](https://github.com/ChilliCream/hotchocolate/issues/4183)\n\n`/MyEntity.cs`\n``` csharp\npublic class MyEntity\n{\n    public int Id { get; set; }\n}\n```\n\n`/MyEntityTypeExtension.cs`\n``` csharp\n[ExtendObjectType(typeof(MyEntity))]\npublic class MyEntityTypeExtension\n{\n    public IEnumerable\u003cstring\u003e GetMyList() =\u003e new List\u003cstring\u003e { \"foo\", \"bar\" };\n}\n```\n\n`/MyDbContext.cs`\n``` csharp\npublic class MyDbContext : DbContext\n{\n    public DbSet\u003cMyEntity\u003e MyEntities { get; set; } = null!;\n\n    public MyDbContext(DbContextOptions options) : base(options) { }\n}\n```\n\n`/Query.cs`\n``` csharp\npublic class Query\n{\n    [UseDbContext(typeof(MyDbContext))]\n    [UseProjection]\n    public IQueryable\u003cMyEntity\u003e GetMyEntities([ScopedService] MyDbContext dbContext) =\u003e dbContext.MyEntities;\n}\n```\n\n`/Program.cs`\n``` csharp\nvar builder = WebApplication.CreateBuilder(args);\n\nbuilder.WebHost.ConfigureServices((webHost, services) =\u003e\n{\n    services.AddPooledDbContextFactory\u003cMyDbContext\u003e(builder =\u003e\n    {\n        builder.UseInMemoryDatabase(databaseName: \"MyDatabase\");\n    });\n\n    services.AddGraphQLServer()\n        .AddQueryType\u003cQuery\u003e()\n        .AddTypeExtension\u003cMyEntityTypeExtension\u003e()\n        .AddProjections();\n});\n\nvar app = builder.Build();\n\napp.UseRouting();\n\napp.UseEndpoints(e =\u003e e.MapGraphQL());\n\napp.Run();\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobjmarks%2Ftypeextensionprojectiondemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobjmarks%2Ftypeextensionprojectiondemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobjmarks%2Ftypeextensionprojectiondemo/lists"}