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