Use a Inline Table-Valued Functions with Linq and Entity Framework Core

I created an Inline Table-Valued Functions (ITVF) in SQL Server that returns a table of values (query simplified for discussion purposes): ``` CREATE FUNCTION dbo.VehicleRepairStatus() RETURNS TABLE ...

Spring post method "Required request body is missing"

``` @PostMapping(path="/login") public ResponseEntity<User> loginUser(@RequestBody Map<String, String> userData) throws Exception { return ResponseEntity.ok(userService.login(userData)); } ``` I...

24 Oct at 18:14

How do you access appsetting.json parameters in an AuthorizeAttribute class in .Net Core

In my ASP.NET Core MVC app, I have a class that inherits from AuthorizeAttribute and implements IAuthorizationFilter. ``` namespace MyProject.Attributes { [AttributeUsage(AttributeTargets.Class |...

Entity Framework Core - Setting Value Converter generically

I'm currently trialing Entity Framework Core 2.1 with a view to using it in the company I work for's business applications. I've got most of the way in implementing Value Converters in my test project...

NSubstitute : Mocking REST API, return result based on parameter value

I am using NSubstitute to mock result of servicestack REST API which returns the employee object ``` var mockedCoreService = Substitute.For<jsonClient>(ApiUrl); //Create the employee to return for ...

16 Feb at 06:39

Ambiguous match found when using reflection to find Generic method

I'm using reflection to find the generic method for Newtonsoft `JsonConvert.DeserializedObject` but am finding that it's returning an ambiguous match for the non-generic version `JsonConvert.Deseriali...

How to prevent a JsConfig scope from affecting global settings

In `AppHost.Configure` I set a global JSON config `JsConfig.TreatEnumAsInteger = false;` and have a simple handler with two GET endpoints ``` public object Get(GetDayOfWeekAsText request) { retur...

23 Oct at 20:35

How to prevent RequestLogsFeature from skipping a request after a Gateway call is made during request handling

If a request handler uses the build-in `IServiceGateway` the request called by the gateway will be logged, not the original request. e.g. ``` public object Post(DoSomething request) { /* handle r...

23 Oct at 20:11

ASP.NET Core 2.1 no HTTP/HTTPS redirection in App Engine

# Problem I could not get the automatic redirection from HTTP to HTTPS to work correctly when the app is published to App Engine. When i access the website through the site got routed to [http:/...

grpc unhandled exception StatusCode=Unknown when invoking a method generated from a proto file

I have a client and server and get an unhandled exception of type `Grpc.Core.RpcException` with `Status(StatusCode=Unknown, Detail="Exception was thrown by handler.")` when invoking the `SendMessage`...

15 Jan at 14:23

Could not install packages due to an EnvironmentError: [Errno 13]

In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says: ``` You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading v...

6 Sep at 13:59

Bool value of Tensor with more than one value is ambiguous in Pytorch

I want to create a model in pytorch, but I can't compute the loss. It's always return Actually, I run example code, it work. ``` loss = CrossEntropyLoss() input = torch.randn(8, 5) input target = ...

11 Jun at 12:48

How to get HttpRequest body in .net core?

I want to get Http Request body in .net core , I used this code: ``` using (var reader = new StreamReader(req.Body, Encoding.UTF8)) { bodyStr = reader.ReadToEnd(); } req.Body.Position = 0 ```...

How to execute .Net Core 2.0 Console App using Windows Task Scheduler?

I have one Console App which is created using `asp.net Core 2.0` in `VS2017`. Now I want to run this application on particular time period repeatedly (like service). So I have tried this using `Window...

Why are 1000 threads faster than a few?

I have a simple program that searches linearly in an array of 2D points. I do 1000 searches into an array of 1 000 000 points. The curious thing is that if I spawn 1000 threads, the program works as...

25 Oct at 16:5

CSS `height: calc(100vh);` Vs `height: 100vh;`

I'm working on a project where the former developer used: ``` .main-sidebar { height: calc(100vh); } ``` I have no way to contact him/her anymore, and I would like to understand what is the dif...

23 Oct at 04:46

The SSL connection could not be established

I am using a third party library ([Splunk c# SDK](http://dev.splunk.com/csharp) ) in my ASP.NET core application. I am trying to connect to my localhost Splunk service via this SDK, but I get an exce...

Why CancellationToken is a struct?

Does it make any sense to use a struct instead of a reference type in case of CancellationToken? I see one possible disadvantage, it will be copied all the way down in methods chain as I pass it as a...

22 Oct at 20:50

ServiceStack IdentityServer4 - IdentityServerAuthFeature

I want to use IdentityServer with my ServiceStack API, however, when I add this in my Startup.cs in this method: ``` Plugins.Add(new IdentityServerAuthFeature { AuthProviderType = Iden...

23 Oct at 14:31

How to make partial method async

I have a generated code with partial method ``` { ... partial void InterceptOperationCall(IOperationContext context); ... async Task SomeMethod() { InterceptOperationCal...

25 Oct at 08:23

Unable to resolve ILogger from Microsoft.Extensions.Logging

I've configured my console application's `Main` like so ``` var services = new ServiceCollection() .AddLogging(logging => logging.AddConsole()) .BuildServiceProvider(); ``` And then I try to ...

IHttpClientFactory in .NET Core 2.1 Console App references System.Net.Http

- - I'm attempting to create a console app using the dotnet core framework. The console app needs to make API requests. I've read about the new `IHttpClientFactory` released as part of d...

21 Oct at 17:27

Quotes not around values in CSV

I'm using `ToCsv()` on a collection to convert it to CSV text. None of the values have quotes around them - even when there are spaces in them. How do I switch quotes on?

21 Oct at 17:26

How to change the border color of MUI TextField

I can't seem to figure out how to change the outline color of an outlined variant `TextField` I looked around GitHub issues and people seem to be pointing towards using the `TextField` "InputProps" Pr...

3 Nov at 06:33

Need help on monogame screen resolution and intersection

Currently in my game i want trying to move my object towards both x axis and y axis.As I also wanted to put it into center ,I have put a camera.Here is my Camera code- ``` public class Camera { p...

15 Dec at 08:24