{"id":28713341,"url":"https://github.com/nicogis/devartxaf","last_synced_at":"2026-01-30T07:06:40.483Z","repository":{"id":297579148,"uuid":"996875032","full_name":"nicogis/DevartXAF","owner":"nicogis","description":"A custom T4 template designed for use with the DevExpress eXpressApp Framework (XAF)","archived":false,"fork":false,"pushed_at":"2025-06-06T07:43:17.000Z","size":3453,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-06T08:25:15.164Z","etag":null,"topics":["devart","devexpress","xaf-blazor"],"latest_commit_sha":null,"homepage":"","language":null,"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/nicogis.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,"zenodo":null}},"created_at":"2025-06-05T15:41:17.000Z","updated_at":"2025-06-06T07:43:18.000Z","dependencies_parsed_at":"2025-06-06T08:35:44.016Z","dependency_job_id":null,"html_url":"https://github.com/nicogis/DevartXAF","commit_stats":null,"previous_names":["nicogis/devartxaf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicogis/DevartXAF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicogis%2FDevartXAF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicogis%2FDevartXAF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicogis%2FDevartXAF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicogis%2FDevartXAF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicogis","download_url":"https://codeload.github.com/nicogis/DevartXAF/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicogis%2FDevartXAF/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259901390,"owners_count":22929227,"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":["devart","devexpress","xaf-blazor"],"created_at":"2025-06-15T00:10:02.722Z","updated_at":"2026-01-30T07:06:40.477Z","avatar_url":"https://github.com/nicogis.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛠 Custom T4 Template Setup for Devart EF Core with DevExpress XAF\n\n## ✅ Requirements\n\nBefore you start, make sure you have the following installed:\n\n- **DevExpress XAF (eXpressApp Framework) (25.1.x)** \n  - [DevExpress XAF](https://www.devexpress.com/products/net/application_framework/)\n\n- **Devart Entity Developer (Edition for Entity Framework) (7.3.235)**\n  - [Devart Entity Developer](https://www.devart.com/entitydeveloper/entity-framework-core-designer.html)\n\n---\n\n## 📁 Template Location\n\nThere are two files:\n- `.tmpl` (T4 template file)\n- `.xml` (metadata)\n\nCopy the two files into the folder located at:\n\n```\nC:\\Program Files (x86)\\Common Files\\Devart\\EntityDeveloper\\Shared Templates\n```\n\n\n---\n\n## 🔧 Step-by-Step Instructions\n\n1. **Create an app using the XAF wizard.**\n\n2. **Save, close, and reopen the project.**\n\n3. **Create a new Devart EF Core model file.**\n     - Right-click \u003e Add \u003e New Item\n     - Choose: `Data` or `ASP.NET Core \u003e Data`\n     - Select: **Devart EF Core Model**\n\n4. **Select \"Database First\" approach.**\n\n5. **Configure the SQL Server connection.**\n   - Choose server and database.\n   - In **Advanced**, set the following:\n     ```\n     MultipleActiveResultSets=True\n     Encrypt=True\n     TrustServerCertificate=True\n     ```\n\n6. **Generate model from database.**\n   - Select the desired tables or select them later.\n\n7. **Leave the default settings**\n  \n8. **Configure context and namespace:**\n    - Namespace context/entities: \u0026lt;YourNameProject\u0026gt;.Module.BusinessObjects\n    - Context Class Name: \u0026lt;YourNameProject\u0026gt;EFCoreDbContext\n  \n9. **Add the custom template:**\n    - Click the first \"Add Template\" button\n    - From `Shared`, choose: **EF Core XAF**\n    - Remove any other existing template\n\n10. **Click \"Finish\" to complete the setup.**\n\n11. **Change code in XAF wizard**\n```csharp\n//[TypesInfoInitializer(typeof(TelemacoContextInitializer))]\npublic partial class TelemacoEFCoreDbContext : DbContext {\n    //public TelemacoEFCoreDbContext(DbContextOptions\u003cTelemacoEFCoreDbContext\u003e options) : base(options) {\n    //}\n    //public DbSet\u003cModuleInfo\u003e ModulesInfo { get; set; }\n\n    partial void OnModelCreatingPartial(ModelBuilder modelBuilder)\n    {\n        modelBuilder.UseDeferredDeletion(this);\n        modelBuilder.UseOptimisticLock();\n        modelBuilder.SetOneToManyAssociationDeleteBehavior(DeleteBehavior.SetNull, DeleteBehavior.Cascade);\n        modelBuilder.HasChangeTrackingStrategy(ChangeTrackingStrategy.ChangingAndChangedNotificationsWithOriginalValues);\n        modelBuilder.UsePropertyAccessMode(PropertyAccessMode.PreferFieldDuringConstruction);\n    }\n    \n}\n```\n     \n\n---\n\n## ✅ Result\n\nYour Devart EF Core model will now generate code that’s fully compatible with DevExpress XAF using the customized T4 template.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicogis%2Fdevartxaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicogis%2Fdevartxaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicogis%2Fdevartxaf/lists"}