You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proof of concept showing how roslyn can be given access to the entire Application layer. This is insanely powerful if we add a feature that allows system admins to add their own code.
Examples:
Receive an HTTP Post, save data to db, and then send an email notification.
Receive an HTTP Post, make an API call to an external service
[Route(RAYTHA_ROUTE_PREFIX + "/roslyn", Name = "roslyn")]
public async Task<IActionResult> Roslyn()
{
Globals g = new Globals
{
Emailer = Emailer,
Mediator = Mediator
};
var scriptOptions = ScriptOptions.Default
.WithReferences(typeof(GetDashboardMetrics.Query).Assembly)
.WithImports("System")
.WithImports("System.Threading.Tasks")
.WithImports("Raytha.Application.Dashboard.Queries")
.WithImports("Raytha.Application.ContentItems.Queries");
string script = @"
var result = await Mediator.Send(new GetContentItemById.Query { Id = ""x37LR9WiMESkii46Y-OAuA"" });
result
";
var scriptResult = await CSharpScript.EvaluateAsync(script, scriptOptions, g);
return Ok(scriptResult);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Proof of concept showing how roslyn can be given access to the entire Application layer. This is insanely powerful if we add a feature that allows system admins to add their own code.
Examples:
Beta Was this translation helpful? Give feedback.
All reactions