{"id":19553938,"url":"https://github.com/borisdj/efcore.utilextensions","last_synced_at":"2025-07-30T03:06:24.777Z","repository":{"id":195801696,"uuid":"693139857","full_name":"borisdj/EFCore.UtilExtensions","owner":"borisdj","description":"Entity Framework Core Data Annotations with extra attributes, Audit Info config, Generics","archived":false,"fork":false,"pushed_at":"2024-12-17T15:30:24.000Z","size":402,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T18:02:56.454Z","etag":null,"topics":["annotations","attributes","audit","entity-framework-core"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borisdj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-09-18T12:35:20.000Z","updated_at":"2025-02-26T08:03:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"eeb2ae1c-ff93-49d0-8cad-83c61d8e11ea","html_url":"https://github.com/borisdj/EFCore.UtilExtensions","commit_stats":null,"previous_names":["borisdj/efcore.utilextensions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdj%2FEFCore.UtilExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdj%2FEFCore.UtilExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdj%2FEFCore.UtilExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borisdj%2FEFCore.UtilExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borisdj","download_url":"https://codeload.github.com/borisdj/EFCore.UtilExtensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251057331,"owners_count":21529638,"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":["annotations","attributes","audit","entity-framework-core"],"created_at":"2024-11-11T04:25:20.249Z","updated_at":"2025-04-26T21:31:25.923Z","avatar_url":"https://github.com/borisdj.png","language":"C#","funding_links":["https://www.buymeacoffee.com/boris.dj"],"categories":[],"sub_categories":[],"readme":"# EFCore.UtilExtensions\nSeveral useful addons for EF (Entity Framework Core):  \n1. UnPluralizing convention,\n1. Data Annotations with extra attributes,\n2. EntityId and Enum interface,\n3. Audit Info config,\n4. Generics.\n\nLogo  \n\u003cimg src=\"EFCoreUtilLogo.png\" height=60\u003e\n\n[![NuGet](https://img.shields.io/npm/l/express.svg)](https://github.com/borisdj/EFCore.UtilExtensions/blob/master/LICENSE)  \n\n*Note: *Still in progres...*\n\nAlso take a look into others packages:\u003c/br\u003e\n-Open source (MIT or cFOSS) authored [.Net libraries](https://infopedia.io/dot-net-libraries/) (@**Infopedia.io** personal blog post)\n| №  | .Net library             | Description                                              |\n| -  | ------------------------ | -------------------------------------------------------- |\n| 1  | [EFCore.BulkExtensions](https://github.com/borisdj/EFCore.BulkExtensions) | EF Core Bulk CRUD Ops (**Flagship** Lib) |\n| 2* | [EFCore.UtilExtensions](https://github.com/borisdj/EFCore.UtilExtensions) | EF Core Custom Annotations and AuditInfo |\n| 3  | [EFCore.FluentApiToAnnotation](https://github.com/borisdj/EFCore.FluentApiToAnnotation) | Converting FluentApi configuration to Annotations |\n| 4  | [ExcelIO.FastMapper](https://github.com/borisdj/ExcelIO.FastMapper) | Excel Input Output Mapper to-from Poco \u0026 .xlsx with attribute |\n| 5  | [FixedWidthParserWriter](https://github.com/borisdj/FixedWidthParserWriter) | Reading \u0026 Writing fixed-width/flat data files |\n| 6  | [CsCodeGenerator](https://github.com/borisdj/CsCodeGenerator) | C# code generation based on Classes and elements |\n| 7  | [CsCodeExample](https://github.com/borisdj/CsCodeExample) | Examples of C# code in form of a simple tutorial |\n\n## Support\nIf you find this project useful you can mark it by leaving a Github **Star** :star:  \nAnd even with community license, if you want help development, you can make a DONATION:  \n[\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png\" alt=\"Buy Me A Coffee\" height=28\u003e](https://www.buymeacoffee.com/boris.dj) _ or _ \n[![Button](https://img.shields.io/badge/donate-Bitcoin-orange.svg?logo=bitcoin):zap:](https://borisdj.net/donation/donate-btc.html)\n\n## Contributing\nPlease read [CONTRIBUTING](CONTRIBUTING.md) for details on code of conduct, and the process for submitting pull requests.  \nWhen opening issues do write detailed explanation of the problem or feature with reproducible example.  \nWant to **Contact** for Development \u0026 Consulting: [www.codis.tech](http://www.codis.tech) (*Quality Delivery*) \n\n**FEATURES:**\n\n#### 1. **UnPluralize**\nKeeps table names singular in DB like Entities classes are (also keeping PascalCase) while DbSets remains in plural.\nTo set it up, call `RemovePluralizingTableNameConvention` from `OnModelCreating`:\n```C#\nprotected override void OnModelCreating(ModelBuilder modelBuilder)\n{\n    modelBuilder.RemovePluralizingTableNameConvention();\n    ...\n}\n```\nNOTE: Useful for versions prior to .Net7, mainly for .Net6, since with .Net7+ it can be achieved directly by overriding a method in DbContext:\n```C#\n// In DbContext\nprotected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)\n{\n    configurationBuilder.Conventions.Remove(typeof(TableNameFromDbSetConvention));\n}\n```\n\n#### 2. ANNOTATIONS Extensions  \nAre made to avoid using FluentAPI and keep all Db configs in a single place on Entity  \n(makes it more clear and simple - [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) principle)  \nImplemented with method `ConfigureExtendedAnnotations` on ***modelBuilder*** called from *OnModelCreating*.\n    \n-New Attributes from the library:  \n| Attributes                              | Description                                                    |\n| --------------------------------------- | -------------------------------------------------------------- |\n| `[Index()]`                             | enables configuring Index on one or several columns            |\n| `[UniqueIndex()]`                       | enables configuring Unique Index on one or several columns     |\n| `[DefaultValue(object)]  `              | sets Db default value                                          |\n| `[DefaultValueSql(\"getdate()\")]`        | sets Db default value with Sql                                 |\n| `[ForeignKeyExtension(DeleteBehavior.)]`| extends FK attribute, adds option to set DeleteBehavior        |\n| `             DeleteBehavior.NoAction`  | sometimes needed to avoid fk cascade multiple paths and cycles |\n\n-Native ones from EF are:  \n| Attributes                 | Attributes                   |  Attributes             |  Attributes     |\n| -------------------------- | ---------------------------- | ----------------------- | --------------- |\n| `[Table(tblName)]`         | `[Key]`                      | `[DatabaseGenerated()]` | `[Owned]`       |\n| `[Column(name, typeName)]` | `[ForeignKey(FkName)]`       | `[Timestamp]`           | `[ComplexType]` |\n| `[Required]`               | `[Index(indName)]`           | `[ConcurrencyCheck]`    | `[NotMapped]`   |\n| `[MaxLength(255)]`         | `[Index(indName, IsUnique)]` | `[Precision(20, 4)]`    |                 |\n\nNotes:  \n`[Precision]` is used for customizing Decimal type, default being (18, 2) meaning 18 significant digits of which 16 is for whole number and 2 decimal places.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisdj%2Fefcore.utilextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborisdj%2Fefcore.utilextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborisdj%2Fefcore.utilextensions/lists"}