18 references to MyService
Microsoft.Extensions.AI.Tests (18)
Functions\AIFunctionFactoryTest.cs (18)
314
func = AIFunctionFactory.Create((
MyService
myService) => myService.Value);
321
Assert.Throws<NotSupportedException>(() => AIFunctionFactory.Create((
MyService
myService) => myService.Value));
327
func = AIFunctionFactory.Create((
MyService
? myService = null) => myService?.Value ?? 456);
334
Assert.Throws<NotSupportedException>(() => AIFunctionFactory.Create((
MyService
myService) => myService.Value));
338
func = AIFunctionFactory.Create((
MyService
myService) => myService.Value, new() { Services = sp });
345
func = AIFunctionFactory.Create((
MyService
? myService = null) => myService?.Value ?? 456, new() { Services = sp });
482
MyService
service = new(42);
488
AIFunction f = AIFunctionFactory.Create(([FromKeyedServices("key")]
MyService
service, int myInteger) => service.Value + myInteger);
503
MyService
service = new(42);
509
AIFunction f = AIFunctionFactory.Create(([FromKeyedServices(null!)]
MyService
service, int myInteger) => service.Value + myInteger);
524
MyService
service = new(42);
530
AIFunction f = AIFunctionFactory.Create(([FromKeyedServices("key")]
MyService
? service = null, int myInteger = 0) =>
546
MyService
service = new(42);
549
(
MyService
service, int myInteger) => service.Value + myInteger,
554
if (p.ParameterType == typeof(
MyService
))
559
a.Context?.TryGetValue(typeof(
MyService
), out object? service) is true ? service :
588
[typeof(
MyService
)] = service
601
(IServiceProvider services) => services.GetRequiredService<
MyService
>().Value,