{"id":21864788,"url":"https://github.com/fluxera/fluxera.extensions","last_synced_at":"2025-04-14T21:02:12.290Z","repository":{"id":37855521,"uuid":"437283463","full_name":"fluxera/Fluxera.Extensions","owner":"fluxera","description":"A library that extends the Microsoft.Extensions.* libraries with custom functionality and also provides custom extensions.","archived":false,"fork":false,"pushed_at":"2024-11-14T15:14:56.000Z","size":314,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T15:46:42.445Z","etag":null,"topics":["dependency-injection","dotnet","dotnet6","dotnet7","dotnet8","microsoft-extensions","microsoft-extensions-caching-memory","microsoft-extensions-configuration","microsoft-extensions-di","microsoft-extensions-http","microsoft-extensions-localization","microsoft-extensions-logging","validation"],"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/fluxera.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":"2021-12-11T13:01:10.000Z","updated_at":"2024-11-14T15:14:37.000Z","dependencies_parsed_at":"2023-11-15T17:47:53.894Z","dependency_job_id":"7d582efa-dfcf-4e6d-80bb-ca7cf494e81a","html_url":"https://github.com/fluxera/Fluxera.Extensions","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluxera%2FFluxera.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluxera%2FFluxera.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluxera%2FFluxera.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluxera%2FFluxera.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluxera","download_url":"https://codeload.github.com/fluxera/Fluxera.Extensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226857027,"owners_count":17693016,"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":["dependency-injection","dotnet","dotnet6","dotnet7","dotnet8","microsoft-extensions","microsoft-extensions-caching-memory","microsoft-extensions-configuration","microsoft-extensions-di","microsoft-extensions-http","microsoft-extensions-localization","microsoft-extensions-logging","validation"],"created_at":"2024-11-28T04:12:24.638Z","updated_at":"2024-11-28T04:12:28.841Z","avatar_url":"https://github.com/fluxera.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://dev.azure.com/fluxera/Foundation/_apis/build/status/GitHub/fluxera.Fluxera.Extensions?branchName=main\u0026stageName=BuildAndTest)](https://dev.azure.com/fluxera/Foundation/_build/latest?definitionId=85\u0026branchName=main)\n\n## Fluxera.Extensions\nA library that extends the Microsoft.Extensions.* libraries with custom functionality and also provices custom extensions.\n\n### ```Fluxera.Extensions.Caching```\n\nThis extension contains ```Option``` classes for configuring a remote distributed cache server and\nseveral useful extension methods for the ```IDistributedCache``` service.\n\n### ```Fluxera.Extensions.Common```\n\nThis extension contains several custom services:\n\n- ```IDateTimeOffsetProvider``` A service that provides mockable access to static ```DateTimeOffset```.\n- ```IDateTimeProvider``` A service that provides mockable access to static ```DateTime```.\n- ```IGuidGenerator``` A service to generate ```Guid``` using different generators.\n- ```IHashCalculator``` A service to calculate hashes from input values.\n- ```IJitterCalculator``` A service that adds entropy to any given number.\n- ```IPasswordGenerator``` A service that generates random passwords.\n- ```IRetryDelayCalculator``` A service that calculates retry delay with (truncated) binary exponential back-off.\n- ```IStringEncryptionService``` A service that can be used to simply encrypt/decrypt texts.\n\n### ```Fluxera.Extensions.DataManagement```\n\nThis extension contains an infrastructure for inserting seed data into databases.\n\n### ```Fluxera.Extensions.DependencyInjection```\n \nThis extension contains several additions to the dependency injection extension.\n\n- Decorator\n  - Add decorators to services.\n- Named Services\n  - Add named service implementations.\n- Lazy Services\n  - Add ```Lazy\u003cT\u003e``` as open generic sevice type. Any service will be resolved lazily from it.\n- Object Accessor\n  - Provides a way to access object instances from the ```IServiceCollection``` while still configuring services.\n\n### ```Fluxera.Extensions.Http```\n\nThis extension provides a way to register named ```HttpClient``` services and several custom ```DelegatingHandler``` implementations.\n\n```C#\npublic interface ITestHttpClientService : IHttpClientService\n{\n    Task\u003cstring\u003e GetSomethingAsync();\n}\n\npublic class TestHttpClientService : HttpClientServiceBase, ITestHttpClientService\n{\n    /// \u003cinheritdoc /\u003e\n    public TestHttpClientService(string name, HttpClient httpClient, RemoteService options)\n        : base(name, httpClient, options)\n    {\n    }\n\n    public async Task\u003cstring\u003e GetSomethingAsync()\n    {\n        HttpResponseMessage response = await this.HttpClient.GetAsync(\"/\");\n        return await response.Content.ReadAsStringAsync();\n    }\n}\n\nservices.AddHttpClientService\u003cITestHttpClientService, TestHttpClientService\u003e(\n\tcontext =\u003e new TestHttpClientService(context.Name, context.HttpClient, context.Options));\n```\n\n### ```Fluxera.Extensions.Localization```\n\nThis extension contains several extension methods ```IStringLocalizer``` service.\n\n### ```Fluxera.Extensions.OData```\n\nThis extension provides a way to register named ```ODataClient``` services using ```Simple.OData.Client```.\n\n```C#\npublic interface ITestODataClientService : IODataClientService\n{\n}\n\npublic class TestODataClientService : ODataClientServiceBase\u003cPerson, string\u003e, ITestODataClientService\n{\n    /// \u003cinheritdoc /\u003e\n    public TestODataClientService(string name, string collectionName, IODataClient oDataClient, RemoteService options)\n        : base(name, collectionName, oDataClient, options)\n    {\n    }\n}\n\nservices.AddODataClientService\u003cITestODataClientService, TestODataClientService\u003e(\"People\",\n    context =\u003e new TestODataClientService(context.Name, context.CollectionName, context.ODataClient, context.Options));\n```\n\n### ```Fluxera.Extensions.Validation```\n\nThis extension provides an abstraction over validation frameworks. Any one framework can\nbe used together with other ones. The validation results will merged by the extension.\n\nAt the moment ```System.ComponentModel.Annotations``` and ```FluentValidation``` is supported.\nOne can configure the validators to use like this:\n\n```C#\nIServiceCollection services = new ServiceCollection();\n\nservices.AddValidation(builder =\u003e\n{\n    builder\n        .AddDataAnnotations()\n        .AddFluentValidation(registration =\u003e\n        {\n            registration.AddValidator\u003cPersonValidator\u003e();\n        });\n});\n```\n\n\n## References\n\n[Steve Collins](https://stevetalkscode.co.uk/)\n\n- [Named Dependencies Part 1](https://stevetalkscode.co.uk/named-dependencies-part-1)\n- [Named Dependencies Part 2](https://stevetalkscode.co.uk/named-dependencies-part-2)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxera%2Ffluxera.extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluxera%2Ffluxera.extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluxera%2Ffluxera.extensions/lists"}