{"id":23343315,"url":"https://github.com/ponyspeed888/eftemplate","last_synced_at":"2025-04-07T16:20:15.335Z","repository":{"id":246034546,"uuid":"819901881","full_name":"ponyspeed888/EFTemplate","owner":"ponyspeed888","description":"Custom Reverse Engineering Templates for ef core 8","archived":false,"fork":false,"pushed_at":"2024-06-26T12:21:32.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T18:42:47.668Z","etag":null,"topics":["custom-reverse-engineering-templates","efcore","reverse-engineering"],"latest_commit_sha":null,"homepage":"","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/ponyspeed888.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-25T12:03:50.000Z","updated_at":"2024-06-26T12:21:36.000Z","dependencies_parsed_at":"2024-06-26T15:19:46.357Z","dependency_job_id":"d4358545-1346-40aa-89b6-70058bdbaf29","html_url":"https://github.com/ponyspeed888/EFTemplate","commit_stats":null,"previous_names":["ponyspeed888/eftemplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyspeed888%2FEFTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyspeed888%2FEFTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyspeed888%2FEFTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyspeed888%2FEFTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ponyspeed888","download_url":"https://codeload.github.com/ponyspeed888/EFTemplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685633,"owners_count":20979085,"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":["custom-reverse-engineering-templates","efcore","reverse-engineering"],"created_at":"2024-12-21T06:14:43.672Z","updated_at":"2025-04-07T16:20:15.314Z","avatar_url":"https://github.com/ponyspeed888.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fponyspeed888%2FEFTemplate\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false)](https://hits.seeyoufarm.com)\nThis project is a drop in replacement of Microsoft.EntityFrameworkCore.Templates\nIt has the following changes :\n\n* Add debug support, so that you can debug using Debugger.Launch\n* Allow you to specify which entity want to use EntityTypeConfiguration file\n* MVVM toolkit support\n* Provide the plumbing to better compile time error check\n* Generate dynamic properties per entity, using EF Core 8 Json column or dictionary (To be added)\n* \n\nWhen you install this template with \n\n   dotnet new ponyspeed888-eftemplates\n\nIt will be mostly the same as Microsoft.EntityFrameworkCore.Templates\n\nTo Generate mvvm tool style property use\n\n   dotnet new ponyspeed888-eftemplates --TemplateType mvvm --force\n\n\n\n\nTo specify which entity to generate config file look for this line\n\n    string [] UseConfigure = new string [] { \"Order\", \"OrderDetail\"} ;\n\nand fill with the entity names you want to generate config file.  The generate config file is like :\n\n\npublic partial class OrderConfiguration : IEntityTypeConfiguration\u003cOrder\u003e\n{\n    partial void MoreBuilderCalls (EntityTypeBuilder\u003cOrder\u003e builder);\n\n\n    public void Configure(EntityTypeBuilder\u003cOrder\u003e builder)\n    {\n\n        MoreBuilderCalls (builder) ;\n\n\n    }\n}\n\nSo just implement the partial method MoreBuilderCalls in another manually created class, so that it won't be overwritten when regenerating\n\n\n\nBETTER TEMPLATE ERROR DETECTION AT COMPILE TIME\n\nThe standard reverse engineering only use the t4 template as unstructured text.  It often return an error message that is meaningless. For example, fot hsi code block\n\n    \u003c#\n\n        string StaticExtPropName = \"ExtProp\" ;\n        string DynamicExtPropName = \"ExtPropDynamic\" ;\n        string [] UseConfigure = new stringx [] { \"Order\", \"OrderDetail\"} ;\n\n    #\u003e\n\nit return the following message\n\n\n    Object reference not set to an instance of an object\n\nIf change the t4 template custom tool to \"TextTemplatingFilePreProcessor\", then the error message becomes :\n\nSeverity\tCode\tDescription\tProject\tFile\tLine\tSuppression State\nError (active)\tCS0246\tThe type or namespace name 'stringx' could not be found (are you missing a using directive or an assembly reference?)\tTemplateTestConsoleApp\tU:\\EFTemplate\\TemplateTestConsoleApp\\CodeTemplates\\EFCore\\EntityTypeConfiguration.cs\t44\t\n\nBut this create 2 problems :\n\n1. The generated code reference global::System.Runtime.Remoting.Messaging.CallContext.LogicalGetData, which only exist in .net framework.  To solve the problem, I created a dummy class int JYDummyT4Helper.cs that provide the definition\n2. EntityType.t4 itself use a parameter that use the name also called EntityType.  This will create a compile time error.  My solution is rename EntityType.t4 to entityType.t4\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponyspeed888%2Feftemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fponyspeed888%2Feftemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponyspeed888%2Feftemplate/lists"}