-
Every extended type has it's own project
i.e:
-
string->Elfo.ExtensionMethods.String -
Boolean->Elfo.ExtensionMethods.Boolean
-
-
If the project related to your type doesn't exist, then create it (type is .NET Standard Library)
and replace the content of the
.csprojwith this:<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>net40;net452;net471;netstandard2.0</TargetFrameworks> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net40' "> <DefineConstants>NET40</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net452' "> <DefineConstants>NET452</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'net471' "> <DefineConstants>NET471</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <DefineConstants>NETSTD20</DefineConstants> </PropertyGroup> </Project>
-
Add a new
partial staticclass with this naming convention:*Extended type*ExtensionMethodsi.e:
String->StringExtensionMethods -
Add a new folder at the same level and with the same name of the class created above
-
Inside the folder, create one
.csfile for each extension method you want to add.Name it like the method you want to create, inside the
.csfile extend the partial class created in the step above.Inside the class add as many overloads as you want.
-
ElfoCompany/Elfo.ExtensionMethods
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|

