Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

C# / .NET features #100

Open
AlbertoDePena opened this issue Oct 12, 2020 · 2 comments
Open

C# / .NET features #100

AlbertoDePena opened this issue Oct 12, 2020 · 2 comments

Comments

@AlbertoDePena
Copy link

I just came across this project. Looks so awesome!

A few questions:

  1. Does it support dependency injection (ILogger, repositories, etc) and if so how does it register those dependencies?
  2. Does it support a static class/method (thinking about functions for F#)?

Thanks in advance =)

@andresmgot
Copy link
Contributor

cc/ @allantargino @lorenzo-ange

@edokan
Copy link

edokan commented Oct 20, 2020

I'm not an authority here but, as far as I read the code

  1. No, it does not. It uses reflection to load your compiled assembly and to create your class. No DI system, but it should not be runtime's concern, since in theory your code must work all by itself.
  2. No, it does not. It creates an instance using Activator.CreateInstance, finds your method with GetMethod, and invokes it using Invoke using previously created instance.

https://github.com/kubeless/runtimes/blob/13e5cf5d6d7a6bb8a6aa82ea2aebeed384f3d85f/stable/dotnetcore/src/Kubeless.Core/Invokers/CompiledFunctionInvoker.cs#L19-L32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants