-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
44 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const path = require('path'); | ||
var net = process.argv[2]; | ||
var namespace = 'QuickStart.' + net.charAt(0).toUpperCase() + net.substr(1); | ||
var framework = net.charAt(0).toUpperCase() + net.substr(1); | ||
var namespace = 'QuickStart.' + framework; | ||
if(net === 'core') net = ''; | ||
var version = net == 'standard' ? '2.0' : '7.0' | ||
|
||
|
@@ -61,28 +62,30 @@ var listCertificates = edge.func({ | |
var getInlinePerson = edge.func({ | ||
source: function () {/* | ||
using System.Threading.Tasks; | ||
using System; | ||
public class Person | ||
public class Person | ||
{ | ||
public Person(string name, string email, int age) | ||
{ | ||
public Person(string name, string email, int age) | ||
{ | ||
Name = name; | ||
Email = email; | ||
Age = age; | ||
} | ||
public string Name {get;set;} | ||
public string Email {get;set;} | ||
public int Age {get;set;} | ||
Id = Guid.NewGuid(); | ||
Name = name; | ||
Email = email; | ||
Age = age; | ||
} | ||
public class Startup | ||
public Guid Id {get;} | ||
public string Name {get;set;} | ||
public string Email {get;set;} | ||
public int Age {get;set;} | ||
} | ||
public class Startup | ||
{ | ||
public async Task<object> Invoke(dynamic input) | ||
{ | ||
public async Task<object> Invoke(dynamic input) | ||
{ | ||
Person person = new Person(input.name, input.email, input.age); | ||
return person; | ||
} | ||
} | ||
return new Person(input.name, input.email, input.age); | ||
} | ||
} | ||
*/} | ||
}); | ||
|
||
|
@@ -113,7 +116,7 @@ getCurrentTime('', function(error, result) { | |
console.log(); | ||
}); | ||
|
||
useDynamicInput('Node.Js', function(error, result) { | ||
useDynamicInput({framework: framework, node: 'Node.Js'}, function(error, result) { | ||
if (error) throw error; | ||
console.log(localTypeName + '.UseDynamicInput'); | ||
console.log(result); | ||
|
@@ -142,7 +145,7 @@ try{ | |
console.log(); | ||
console.log('### Calling external library methods using '+ namespace +'.dll wrapper'); | ||
console.log(); | ||
getPerson('', function(error, result) { | ||
getPerson({name: 'John Smith', email: '[email protected]', age: 35}, function(error, result) { | ||
if (error) throw error; | ||
console.log(externalTypeName + '.GetPersonInfo'); | ||
console.log(result); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,16 @@ namespace ExternalLibrary | |
{ | ||
public class Person | ||
{ | ||
public Guid Id => Guid.NewGuid(); | ||
public string Name => "John Smith"; | ||
public string Email => "[email protected]"; | ||
|
||
} | ||
|
||
public class Library | ||
{ | ||
public Person GetPerson() | ||
public Person(string name, string email, int age) | ||
{ | ||
return new Person(); | ||
Id = Guid.NewGuid(); | ||
Name = name; | ||
Email = email; | ||
Age = age; | ||
} | ||
public Guid Id {get;} | ||
public string Name {get;} | ||
public string Email {get;} | ||
public int Age {get;} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
using System.Threading.Tasks; | ||
using ExternalLibrary; | ||
using Newtonsoft.Json; | ||
|
||
namespace QuickStart | ||
{ | ||
class ExternalMethods | ||
{ | ||
private readonly Library _library = new Library(); | ||
|
||
public async Task<object> GetPersonInfo(dynamic input) | ||
{ | ||
return await Task.Run(() =>JsonConvert.SerializeObject(_library.GetPerson(), Formatting.Indented)); | ||
return await Task.Run(() => new Person(input.name, input.email, input.age)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters