Skip to content

Commit

Permalink
chore: publish 0.3.0 (masastack#8)
Browse files Browse the repository at this point in the history
* Feature/cache

* add caller

* chore: minimal support specify Assembly

* support net6.0

* chore: close gitlab package

* chore: add package CI

* feat: Improve DI extensions

* chore: update dapr library package

* Feature/cache

* chore: Added support for adding Caller multiple times, and supports automatic...

* add ghpackageconfig

* Add GetAsync method overload

* Update package_push_nuget.org.yml

* Update package_push_github.yml

* Update package_push_github.yml

* feat: add es

* Elasticsearch init

* chore: add MasaElasticClient

* chore: Elasticsearch init

* chore: elasticsearch init

* chore: Improve MasaElasticClient

* chore: Add DocumentExistsAsync

* chore: adjust ElasticsearchRelations

* chore: Support document batch operation

* chore: adjust AddElasticsearch methods

* chore: add AddElasticsearchClient methods

* chore: adjust GetPaginatedListAsync methods

* chore: add alias

* chore:  add GetIndexByAliasAsync

* chore: adjust GetAliasByIndexAsync methods

* chore: Adjust using references

* chore: add pinyin Filter

* chore: adjust MASA.Utils.Data.Elasticsearch

* chore: change methods name

* chore: Adjustment parameters

* chore: replce default IndexName

* chore: add readonly

* chore: Optimize the AddElasticsearch method Optimize the AddElasticsearch method

* chore: Simplified parameter names

Co-authored-by: zhenlei520 <[email protected]>

* Update package_push_github.yml

* Update nuget.config

* feat: migrate old MASA.Framework to MASA.Utils

* chore: add MASA.Utils.Exceptions

* chore: add MASA.Utils.Exceptions

* chore: adjust package

* chore: add MASA.Utils.Enums、add MASA.Utils.Expressions

* chore: Added MASA.Utils.Security.Cryptography, MASA.Utils.Security.Token class libraries

* chore: Added MASA.Utils.Security.Cryptography

* chore: add MASA.Utils.Security.Authentication

* chore: remove warning

* chore: remove warning

* remove warning

* feat: redis & caller

* chore: Caller adds handling of Service exception reporting

* chore: adjust GlobalException

* chore: Fix redis set error

* chore: Response supports null

Co-authored-by: zhenlei520 <[email protected]>

* chore: Fix GetAsync<TResponse> method error (masastack#7)

* feat:dapr (masastack#6)

* chore: add MASA.Utils.Development.Dapr

* chore: dapr init

* chore: Stop dapr process after project is stopped

* chore: Increase get pid based on port

* chore: add dapr daemon, restart dapr after dapr is shut down abnormally, Added OSX system port handling

* chore: dapr supports the default AppPort obtained from ApplicationUrl by default, automatically assigns the grpc and http ports of dapr and automatically supplements environment variables

Supports automatic restart after the dapr process is closed, and the configuration after restart is consistent with the last successful startup configuration

Supports automatic restart of the dapr process after configuration update. Currently, there are no restrictions on HttpPort and GrpcPort. However, if the configuration update changes HttpPort and GrpcPort, the port obtained by DaprClient will be inconsistent with the actual running one. It needs to be adjusted later here.

* chore: remove redundant code

* chore: remove bad code

* fix: Fix AddDapr method enable dapr slidecar error

* feature: add dapr background options

* feature: add dapr background options

* feature: add dapr background options

* chore: Modify log

Co-authored-by: zhenlei520 <[email protected]>

* Delete package_push_github.yml

* update action

* Update package_push_nuget.org.yml

Co-authored-by: zhenlei520 <[email protected]>
Co-authored-by: zhenlei520 <[email protected]>
Co-authored-by: 曹尤先 <[email protected]>
Co-authored-by: 王达 <[email protected]>
Co-authored-by: PollosD <[email protected]>
Co-authored-by: 听雨声 <[email protected]>
  • Loading branch information
7 people authored Feb 22, 2022
1 parent af78655 commit 700ccde
Show file tree
Hide file tree
Showing 235 changed files with 9,843 additions and 88 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ indent_size = 4
insert_final_newline = true
charset = utf-8

# Use Upper Case for constant fields
dotnet_naming_style.upper_case_style.capitalization = all_upper
dotnet_naming_style.upper_case_style.word_separator = _
dotnet_naming_rule.constant_fields_should_be_upper_case.severity = warning
dotnet_naming_rule.constant_fields_should_be_upper_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_upper_case.style = upper_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/package_push_nuget.org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Package Push Nuget
on:
release:
types: [ created ]

jobs:
packeg-build:
name: packeg build and push
runs-on: ubuntu-latest
steps:
- name: git pull
uses: actions/checkout@v2

- name: run a one-line script
run: env

- name: setting dotnet version
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true

- name: restore
run: dotnet restore

- name: build
run: dotnet build --no-restore

- name: pack
run: dotnet pack --include-symbols -p:PackageVersion=$GITHUB_REF_NAME

- name: package push
run: dotnet nuget push "**/*.symbols.nupkg" -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json



33 changes: 0 additions & 33 deletions .gitlab-ci.yml

This file was deleted.

19 changes: 19 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<PackageId>$(AssemblyName)</PackageId>
<PackageIcon>packageIcon.png</PackageIcon>
<Authors>masastack</Authors>
<Copyright>© masastack Corporation. All rights reserved.</Copyright>
<PackageIconUrl>packageIcon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/masastack/MASA.Utils</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
</PropertyGroup>
<ItemGroup>
<None Include="$(RepositoryRoot)packageIcon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) MASA Stack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
128 changes: 128 additions & 0 deletions MASA.Utils.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,46 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Extensions.Depen
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Data.EntityFrameworkCore", "src\Data\MASA.Utils.Data.EntityFrameworkCore\MASA.Utils.Data.EntityFrameworkCore.csproj", "{66CE7FFE-E2DD-43EA-92DB-82A46D1B2215}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caching.Core", "src\Caching\MASA.Utils.Caching.Core\MASA.Utils.Caching.Core.csproj", "{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caching.DistributedMemory", "src\Caching\MASA.Utils.Caching.DistributedMemory\MASA.Utils.Caching.DistributedMemory.csproj", "{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caching.Memory", "src\Caching\MASA.Utils.Caching.Memory\MASA.Utils.Caching.Memory.csproj", "{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caching.Redis", "src\Caching\MASA.Utils.Caching.Redis\MASA.Utils.Caching.Redis.csproj", "{60473B6E-3823-4ADE-A960-53B3F88C9C23}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{72E67141-9CD8-48A9-B27B-F0C924FD4A12}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caller.Core", "src\Caller\MASA.Utils.Caller.Core\MASA.Utils.Caller.Core.csproj", "{3BEAA614-6327-485F-A81D-3937EC7E16B5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caller.HttpClient", "src\Caller\MASA.Utils.Caller.HttpClient\MASA.Utils.Caller.HttpClient.csproj", "{C19B010B-AA4D-46C0-A229-034C3F36C266}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Caller.DaprClient", "src\Caller\MASA.Utils.Caller.DaprClient\MASA.Utils.Caller.DaprClient.csproj", "{68B51DE3-FEA2-4704-B1D0-B9924F754A76}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Exceptions", "src\MASA.Utils.Exceptions\MASA.Utils.Exceptions.csproj", "{A43369A4-ECFC-46C4-AC04-B981AF7FE35D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Data.Elasticsearch", "src\Data\MASA.Utils.Data.Elasticsearch\MASA.Utils.Data.Elasticsearch.csproj", "{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Expressions", "src\Extensions\MASA.Utils.Expressions\MASA.Utils.Expressions.csproj", "{4116F6E9-BFD8-48CE-9453-CFE99650057D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Enums", "src\Extensions\MASA.Utils.Enums\MASA.Utils.Enums.csproj", "{5AE7DCDC-D417-4517-B69D-85C428C007E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Security.Token", "src\Security\MASA.Utils.Security.Token\MASA.Utils.Security.Token.csproj", "{625CB4FB-644F-4865-8CA6-4249EFD34F5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Security.Authentication", "src\Security\MASA.Utils.Security.Authentication\MASA.Utils.Security.Authentication.csproj", "{64E3BA98-199D-46AD-BEE1-113FDB03238B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Security.Cryptography", "src\Security\MASA.Utils.Security.Cryptography\MASA.Utils.Security.Cryptography.csproj", "{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Security.Cryptography.Tests", "test\MASA.Utils.Security.Cryptography.Tests\MASA.Utils.Security.Cryptography.Tests.csproj", "{BBC2C38F-D758-468F-95E6-DC4688A2D1C0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{598A7DA7-898E-429B-992A-B0E586DADA35}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Development.Dapr", "src\Development\MASA.Utils.Development.Dapr\MASA.Utils.Development.Dapr.csproj", "{BA436D03-972D-4B6A-B526-9C44D0FE5E48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MASA.Utils.Development.Dapr.AspNetCore", "src\Development\MASA.Utils.Development.Dapr.AspNetCore\MASA.Utils.Development.Dapr.AspNetCore.csproj", "{C91175C6-68E8-4EC8-8C92-BC6087F53EF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -77,6 +117,74 @@ Global
{66CE7FFE-E2DD-43EA-92DB-82A46D1B2215}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66CE7FFE-E2DD-43EA-92DB-82A46D1B2215}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66CE7FFE-E2DD-43EA-92DB-82A46D1B2215}.Release|Any CPU.Build.0 = Release|Any CPU
{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822}.Release|Any CPU.Build.0 = Release|Any CPU
{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE}.Release|Any CPU.Build.0 = Release|Any CPU
{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2}.Release|Any CPU.Build.0 = Release|Any CPU
{60473B6E-3823-4ADE-A960-53B3F88C9C23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60473B6E-3823-4ADE-A960-53B3F88C9C23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60473B6E-3823-4ADE-A960-53B3F88C9C23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60473B6E-3823-4ADE-A960-53B3F88C9C23}.Release|Any CPU.Build.0 = Release|Any CPU
{3BEAA614-6327-485F-A81D-3937EC7E16B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BEAA614-6327-485F-A81D-3937EC7E16B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BEAA614-6327-485F-A81D-3937EC7E16B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BEAA614-6327-485F-A81D-3937EC7E16B5}.Release|Any CPU.Build.0 = Release|Any CPU
{C19B010B-AA4D-46C0-A229-034C3F36C266}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C19B010B-AA4D-46C0-A229-034C3F36C266}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C19B010B-AA4D-46C0-A229-034C3F36C266}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C19B010B-AA4D-46C0-A229-034C3F36C266}.Release|Any CPU.Build.0 = Release|Any CPU
{68B51DE3-FEA2-4704-B1D0-B9924F754A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68B51DE3-FEA2-4704-B1D0-B9924F754A76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68B51DE3-FEA2-4704-B1D0-B9924F754A76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68B51DE3-FEA2-4704-B1D0-B9924F754A76}.Release|Any CPU.Build.0 = Release|Any CPU
{A43369A4-ECFC-46C4-AC04-B981AF7FE35D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A43369A4-ECFC-46C4-AC04-B981AF7FE35D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A43369A4-ECFC-46C4-AC04-B981AF7FE35D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A43369A4-ECFC-46C4-AC04-B981AF7FE35D}.Release|Any CPU.Build.0 = Release|Any CPU
{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263}.Release|Any CPU.Build.0 = Release|Any CPU
{4116F6E9-BFD8-48CE-9453-CFE99650057D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4116F6E9-BFD8-48CE-9453-CFE99650057D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4116F6E9-BFD8-48CE-9453-CFE99650057D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4116F6E9-BFD8-48CE-9453-CFE99650057D}.Release|Any CPU.Build.0 = Release|Any CPU
{5AE7DCDC-D417-4517-B69D-85C428C007E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AE7DCDC-D417-4517-B69D-85C428C007E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AE7DCDC-D417-4517-B69D-85C428C007E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AE7DCDC-D417-4517-B69D-85C428C007E2}.Release|Any CPU.Build.0 = Release|Any CPU
{625CB4FB-644F-4865-8CA6-4249EFD34F5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{625CB4FB-644F-4865-8CA6-4249EFD34F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{625CB4FB-644F-4865-8CA6-4249EFD34F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{625CB4FB-644F-4865-8CA6-4249EFD34F5B}.Release|Any CPU.Build.0 = Release|Any CPU
{64E3BA98-199D-46AD-BEE1-113FDB03238B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64E3BA98-199D-46AD-BEE1-113FDB03238B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64E3BA98-199D-46AD-BEE1-113FDB03238B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64E3BA98-199D-46AD-BEE1-113FDB03238B}.Release|Any CPU.Build.0 = Release|Any CPU
{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4}.Release|Any CPU.Build.0 = Release|Any CPU
{BBC2C38F-D758-468F-95E6-DC4688A2D1C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBC2C38F-D758-468F-95E6-DC4688A2D1C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBC2C38F-D758-468F-95E6-DC4688A2D1C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBC2C38F-D758-468F-95E6-DC4688A2D1C0}.Release|Any CPU.Build.0 = Release|Any CPU
{BA436D03-972D-4B6A-B526-9C44D0FE5E48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA436D03-972D-4B6A-B526-9C44D0FE5E48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA436D03-972D-4B6A-B526-9C44D0FE5E48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA436D03-972D-4B6A-B526-9C44D0FE5E48}.Release|Any CPU.Build.0 = Release|Any CPU
{C91175C6-68E8-4EC8-8C92-BC6087F53EF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C91175C6-68E8-4EC8-8C92-BC6087F53EF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C91175C6-68E8-4EC8-8C92-BC6087F53EF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C91175C6-68E8-4EC8-8C92-BC6087F53EF1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -95,6 +203,26 @@ Global
{1D6302D8-DA31-4782-A076-AC586A286253} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635}
{00E275C2-3B6A-4F48-AE0B-738AA669226D} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E}
{66CE7FFE-E2DD-43EA-92DB-82A46D1B2215} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93}
{6DBF3335-F4FB-46DE-9FBB-0FA13FB8E822} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}
{582FB57C-0B6C-4B6C-9766-5E5D8998C0BE} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}
{6AA5B8CB-E5A7-44E6-8E67-554CB235E6C2} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}
{60473B6E-3823-4ADE-A960-53B3F88C9C23} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}
{72E67141-9CD8-48A9-B27B-F0C924FD4A12} = {D956582F-4071-47E6-A8E7-4C5A83770045}
{3BEAA614-6327-485F-A81D-3937EC7E16B5} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12}
{C19B010B-AA4D-46C0-A229-034C3F36C266} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12}
{68B51DE3-FEA2-4704-B1D0-B9924F754A76} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12}
{A43369A4-ECFC-46C4-AC04-B981AF7FE35D} = {D956582F-4071-47E6-A8E7-4C5A83770045}
{2FCFEA0A-146E-4F8F-ABCB-DE5A3553A263} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93}
{4116F6E9-BFD8-48CE-9453-CFE99650057D} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E}
{5AE7DCDC-D417-4517-B69D-85C428C007E2} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E}
{4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} = {D956582F-4071-47E6-A8E7-4C5A83770045}
{625CB4FB-644F-4865-8CA6-4249EFD34F5B} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}
{64E3BA98-199D-46AD-BEE1-113FDB03238B} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}
{B59A8DF4-6591-42CE-A9F8-BD0806B4A4C4} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}
{BBC2C38F-D758-468F-95E6-DC4688A2D1C0} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635}
{598A7DA7-898E-429B-992A-B0E586DADA35} = {D956582F-4071-47E6-A8E7-4C5A83770045}
{BA436D03-972D-4B6A-B526-9C44D0FE5E48} = {598A7DA7-898E-429B-992A-B0E586DADA35}
{C91175C6-68E8-4EC8-8C92-BC6087F53EF1} = {598A7DA7-898E-429B-992A-B0E586DADA35}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D7DAA0E6-098F-4B18-8775-64FDA96F1FF0}
Expand Down
9 changes: 1 addition & 8 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="public" value="http://proget-hz.lonsid.cn/nuget/public/v3/index.json" />
<add key="gitlab" value="http://gitlab-hz.lonsid.cn/api/v4/projects/29/packages/nuget/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceCredentials>
<gitlab>
<add key="Username" value="masa" />
<add key="ClearTextPassword" value="2oVCQ7KBG5AsB2s_mFhd" />
</gitlab>
</packageSourceCredentials>
</configuration>
Binary file added packageIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace MASA.Utils.Caching.Core.DependencyInjection;

public class CachingBuilder : ICachingBuilder
{
/// <summary>
/// Initializes a new instance of the <see cref="CachingBuilder"/> class.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add services to.</param>
/// <param name="name"></param>
public CachingBuilder(IServiceCollection services, string name)
{
Services = services;
Name = name;
}

/// <inheritdoc />
public IServiceCollection Services { get; private set; }

/// <inheritdoc />
public string Name { get; private set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace MASA.Utils.Caching.Core.DependencyInjection;

/// <summary>
/// Extension methods for configuring an <see cref="ICachingBuilder"/>
/// </summary>
public static class DistributedCacheClientBuilderExtensions
{
/// <summary>
/// Adds a delegate that will be used to configure a named <see cref="IDistributedCacheClient"/>.
/// </summary>
/// <param name="builder">The <see cref="ICachingBuilder"/>.</param>
/// <param name="configureOptions">A delegate that is used to configure an <see cref="IDistributedCacheClient"/>.</param>
/// <returns>An <see cref="ICachingBuilder"/> that can be used to configure the client.</returns>
public static ICachingBuilder ConfigureDistributedCacheClient<TOptions>(this ICachingBuilder builder, Action<TOptions> configureOptions) where TOptions : class
{
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}

if (configureOptions == null)
{
throw new ArgumentNullException(nameof(configureOptions));
}

builder.Services.Configure(builder.Name, configureOptions);

return builder;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace MASA.Utils.Caching.Core.DependencyInjection;

/// <summary>
/// A builder for configuring named <see cref="ICachingBuilder"/> instances.
/// </summary>
public interface ICachingBuilder
{
/// <summary>
/// Gets the application service collection.
/// </summary>
IServiceCollection Services { get; }

/// <summary>
/// Gets the name of the client configured by this builder.
/// </summary>
string Name { get; }
}
Loading

0 comments on commit 700ccde

Please sign in to comment.