Skip to content

Commit

Permalink
updating code
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Apr 24, 2024
1 parent 8500d05 commit 5675840
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 77 deletions.
18 changes: 16 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ console.log('### Application dll: '+ baseDll);
console.log();
console.log();

var localTypeName = namespace + '.LocalMethods';
var externalTypeName = namespace + '.ExternalMethods';
var localTypeName = 'QuickStart.LocalMethods';
var externalTypeName = 'QuickStart.ExternalMethods';

var getAppDomainDirectory = edge.func({
assemblyFile: baseDll,
Expand Down Expand Up @@ -52,6 +52,12 @@ var getPerson = edge.func({
methodName: 'GetPersonInfo'
});

var listCertificates = edge.func({
assemblyFile: baseDll,
typeName: localTypeName,
methodName: 'ListCertificates'
});

var getItem = edge.func({
source: function () {/*
using System.Threading.Tasks;
Expand Down Expand Up @@ -106,6 +112,14 @@ useDynamicInput('Node.Js', function(error, result) {
console.log();
});

listCertificates({ storeName: 'My', storeLocation: 'LocalMachine' }, function(error, result) {
if (error) throw error;
console.log(localTypeName + '.ListCertificates');
console.log(result);
console.log();
});


console.log();
console.log('### Handling exception');
console.log();
Expand Down
4 changes: 3 additions & 1 deletion src/.idea/.idea.QuickStart/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions src/QuickStart.Core/ExternalLibrary.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/QuickStart.Core/LocalMethods.cs

This file was deleted.

9 changes: 9 additions & 0 deletions src/QuickStart.Core/QuickStart.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@
<Private>true</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\shared\ExternalLibarary.cs">
<Link>ExternalLibarary.cs</Link>
</Compile>
<Compile Include="..\shared\LocalMethods.cs">
<Link>LocalMethods.cs</Link>
</Compile>
</ItemGroup>

</Project>
29 changes: 0 additions & 29 deletions src/QuickStart.Standard/LocalMethods.cs

This file was deleted.

8 changes: 8 additions & 0 deletions src/QuickStart.Standard/QuickStart.Standard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@
<ItemGroup>
<ProjectReference Include="..\ExternalLibrary\ExternalLibrary.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\shared\ExternalLibarary.cs">
<Link>ExternalLibarary.cs</Link>
</Compile>
<Compile Include="..\shared\LocalMethods.cs">
<Link>LocalMethods.cs</Link>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using ExternalLibrary;
using Newtonsoft.Json;

namespace QuickStart.Standard
namespace QuickStart
{
class ExternalMethods
{
Expand Down
51 changes: 51 additions & 0 deletions src/shared/LocalMethods.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace QuickStart
{
public class LocalMethods
{
public async Task<object> GetAppDomainDirectory(dynamic input)

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 12 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
return AppDomain.CurrentDomain.BaseDirectory;
}

public async Task<object> GetCurrentTime(dynamic input)

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 17 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}

public async Task<object> UseDynamicInput(dynamic input)

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 22 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
return $".NET Standard welcomes {input}";
}
public async Task<object> ThrowException(dynamic input)

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 26 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
throw new Exception("Sample Exception");
}

public async Task<object> ListCertificates(dynamic input)

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (macos-14)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (ubuntu-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 31 in src/shared/LocalMethods.cs

View workflow job for this annotation

GitHub Actions / main (windows-latest)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
X509Store store = new X509Store((string)input.storeName, (StoreLocation)Enum.Parse(typeof(StoreLocation), (string)input.storeLocation));
store.Open(OpenFlags.ReadOnly);
try
{
List<string> result = new List<string>();
foreach (X509Certificate2 certificate in store.Certificates)
{
result.Add(certificate.Subject);
}

return result;
}
finally
{
store.Close();
}
}
}
}

0 comments on commit 5675840

Please sign in to comment.