Skip to content

Commit

Permalink
Update slot.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Nov 12, 2023
1 parent d7310f6 commit 1536721
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/files/misc/ide/templates/slot.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Example C# code creating a Hyperlambda slot.
using System;

@@ -10,6 +11,13 @@
[Slot(Name = "foo")]
public class Foo : ISlot
{
/*
* Notice, because the DI container is built during startup, we cannot
* use IoC on dynamically compiled code since we can't rebuild the IoC container.
* This implies we'll have to use the "service locator" pattern to resolve services
* in dynamically compiled C# code.
* It's a drag, but we have no choice really.
*/
readonly IServiceProvider _services;

public Foo(IServiceProvider services)

0 comments on commit 1536721

Please sign in to comment.