diff --git a/csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj b/csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj index a12f3f8249d4c..dc2e720313ba5 100644 --- a/csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj +++ b/csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1 + netstandard2.0;netstandard2.1;net462 @@ -14,6 +14,10 @@ + + + + diff --git a/csharp/src/Apache.Arrow.Flight/Server/GrpcCoreFlightServerExtensions.cs b/csharp/src/Apache.Arrow.Flight/Server/GrpcCoreFlightServerExtensions.cs new file mode 100644 index 0000000000000..92c0af630a3fb --- /dev/null +++ b/csharp/src/Apache.Arrow.Flight/Server/GrpcCoreFlightServerExtensions.cs @@ -0,0 +1,24 @@ +#if NET46_OR_GREATER + +using Apache.Arrow.Flight.Protocol; +using Apache.Arrow.Flight.Server.Internal; +using Grpc.Core; + +namespace Apache.Arrow.Flight.Server +{ + public static class GrpcCoreFlightServerExtensions + { + /// + /// Create a ServerServiceDefinition for use with a Grpc.Core Server + // This allows running a flight server on pre-Kestrel .net Framework versions + /// + /// + /// + public static ServerServiceDefinition CreateServiceDefinition(this FlightServer flightServer) + { + return FlightService.BindService(new FlightServerImplementation(flightServer)); + } + } +} + +#endif