Skip to content

Commit 7852f4c

Browse files
Merge pull request #91 from delegateas/dev
Dev
2 parents c6575df + 8bd225f commit 7852f4c

File tree

7 files changed

+44
-17
lines changed

7 files changed

+44
-17
lines changed

.github/workflows/.releaserc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@ plugins:
1717
- path: ../../artifacts/Documentation.md
1818
label: Documentation
1919

20-
- - "@semantic-release/exec"
21-
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\Delegate.ExpressionEngine.*.nupkg --source https://nuget.pkg.github.com/delegateas/index.json --api-key ${process.env.GITHUB_TOKEN}"
22-
2320
- - "@semantic-release/exec"
2421
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\Delegate.ExpressionEngine.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${process.env.CI_NUGET_API_KEY}"

.github/workflows/build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ jobs:
1313
name: Testing
1414
strategy:
1515
matrix:
16-
dotnet: [ 'netcoreapp3.1', 'net5.0' ]
16+
dotnet: [ 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0' ]
1717
steps:
1818
- name: Checkout code base
1919
uses: actions/checkout@v2
2020

21+
- uses: actions/setup-dotnet@v3
22+
with:
23+
dotnet-version: '7.0.x'
24+
2125
- name: Run tests
2226
run: dotnet test --verbosity normal -f ${{ matrix.dotnet }}
2327

@@ -26,14 +30,14 @@ jobs:
2630
name: Building
2731
strategy:
2832
matrix:
29-
dotnet: ['netcoreapp3.1', 'net5.0']
33+
dotnet: [ 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0' ]
3034
steps:
3135
- name: Checkout code base
3236
uses: actions/checkout@v2
3337

34-
- uses: actions/setup-dotnet@v1
38+
- uses: actions/setup-dotnet@v3
3539
with:
36-
dotnet-version: '5.0.x'
40+
dotnet-version: '7.0.x'
3741

3842
- name: Cleaning
3943
run: dotnet clean
@@ -67,9 +71,9 @@ jobs:
6771
path: build/netcoreapp3.1
6872
key: ${{ runner.os }}-build-netcoreapp3.1
6973

70-
- uses: actions/setup-dotnet@v1
74+
- uses: actions/setup-dotnet@v3
7175
with:
72-
dotnet-version: '5.0.x'
76+
dotnet-version: '7.0.x'
7377

7478
- name: Install Xml to Markdown tool
7579
run: dotnet new tool-manifest && dotnet tool install EAVFW.Extensions.Docs.TransformToMarkdown

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ jobs:
1212
name: Testing
1313
strategy:
1414
matrix:
15-
dotnet: [ 'netcoreapp3.1', 'net5.0' ]
15+
dotnet: [ 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0' ]
1616
steps:
1717
- name: Checkout code base
1818
uses: actions/checkout@v2
19+
20+
- uses: actions/setup-dotnet@v3
21+
with:
22+
dotnet-version: '7.0.x'
1923

2024
- name: Run tests
2125
run: dotnet test --verbosity normal -f ${{ matrix.dotnet }}
@@ -30,9 +34,9 @@ jobs:
3034
- name: Checkout repo
3135
uses: actions/checkout@v2
3236

33-
- uses: actions/setup-dotnet@v1
37+
- uses: actions/setup-dotnet@v3
3438
with:
35-
dotnet-version: '5.0.x'
39+
dotnet-version: '7.0.x'
3640

3741
- uses: actions/setup-node@v2
3842
with:

ExpressionEngine/ExpressionEngine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
55

66
<PackageId>Delegate.ExpressionEngine</PackageId>
77
<Authors>Delegate A/S,thygesteffensen</Authors>

ExpressionEngine/ValueContainer.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public bool IsNumber()
158158
}
159159

160160
/// <summary>
161-
/// Get the value of the ValueContainer has it's respective C# type
161+
/// Get the value of the ValueContainer as its respective C# type
162162
///
163163
/// <code>double</code> and <code>float</code> is converted to <code>decimal</code>.
164164
/// </summary>
@@ -184,11 +184,14 @@ public T GetValue<T>()
184184
{
185185
case { } iEnumerable when iEnumerable == typeof(IEnumerable<ValueContainer>):
186186
return (T) GetValue<List<ValueContainer>>().AsEnumerable();
187-
// case { } array when array == typeof(ValueContainer[]):
188-
// return GetValue<List<ValueContainer>>().ToArray();
189187
}
190188
}
191189

190+
if (typeof(T) == typeof(object))
191+
{
192+
return (T) _value;
193+
}
194+
192195
throw new ExpressionEngineException(
193196
$"Cannot convert ValueContainer of type {_value.GetType()} to {typeof(T)}");
194197
}

Test/Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using ExpressionEngine;
2+
using NUnit.Framework;
3+
4+
namespace Test
5+
{
6+
[TestFixture]
7+
public class TestGetObject
8+
{
9+
[TestCase]
10+
public void TestImplicitConversionThingy()
11+
{
12+
var valueContainer = new ValueContainer("Hello CLR Type!");
13+
14+
var value = valueContainer.GetValue<object>();
15+
16+
Assert.AreEqual(typeof(string), value.GetType());
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)