Пример #1
0
 public GrpcHttpRequestData(RpcHttp httpData, FunctionContext functionContext)
     : base(functionContext)
 {
     _httpData = httpData ?? throw new ArgumentNullException(nameof(httpData));
 }
Пример #2
0
 public GrpcHttpResponseData(FunctionContext functionContext, HttpStatusCode statusCode)
     : this(functionContext, statusCode, new MemoryStream())
 {
 }
 /// <summary>
 /// Gets the function bindings feature for the current context.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>The <see cref="IFunctionBindingsFeature"/>.</returns>
 /// <exception cref="InvalidOperationException">If there is no registered <see cref="IFunctionBindingsFeature"/>.</exception>
 public static IFunctionBindingsFeature GetBindings(this FunctionContext context)
 {
     return(context.Features.GetRequired <IFunctionBindingsFeature>());
 }
Пример #4
0
 public object?CreateInstance(Type instanceType, FunctionContext context)
 {
     return(null);
 }
 public DefaultBindingContext(FunctionContext functionContext)
 {
     _functionContext = functionContext ?? throw new ArgumentNullException(nameof(functionContext));
 }
Пример #6
0
 /// <summary>
 /// Creates a new <see cref="ILogger"/> instance for the specified <see cref="FunctionContext"/>.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="categoryName">The category name for messages produced by the logger.</param>
 /// <returns>The <see cref="ILogger"/>.</returns>
 public static ILogger GetLogger(this FunctionContext context, string categoryName)
 {
     return(context.InstanceServices
            .GetService <ILoggerFactory>() !
            .CreateLogger(categoryName));
 }
Пример #7
0
 /// <summary>
 /// Creates a new <see cref="ILogger"/> instance using the full name of the given type.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>The <see cref="ILogger{T}"/>.</returns>
 public static ILogger <T> GetLogger <T>(this FunctionContext context)
 {
     return(context.InstanceServices.GetService <ILogger <T> >() !);
 }