ServiceStack deserialize xml to object
My current method for deserialization looks like this: ``` public static object Deserialize(string xml, Type toType) { object result = null; using (var stream = new MemoryStream()) { ...
- Modified
- 13 Jul at 04:12
Is it possible to combine [FromRoute] and [FromBody] in ASP.NET Core?
I have an action on API controller like this: ``` [HttpPost] public async Task<IActionResult> StartDeployment( [FromQuery]Guid deploymentId, [FromRoute]RequestInfo requestInfo, [FromBody]...
- Modified
- 13 Jul at 00:47
How can I see 'git diff' on the Visual Studio Code side-by-side file?
I would like to know how to see as a file with the command `git diff master origin/master` in the terminal on Visual Studio Code. I did a `git fetch` from my remote repository, and now I want to see ...
- Modified
- 15 Apr at 04:33
ASP.NET Core 2.1: Navigating back to a page after an HTTP POST fails validation displays a browser error
Using an project, I'm receiving the following browser error message after using the browser back button to return to a form, where the form POST failed server-side validation: Error message in Fir...
- Modified
- 2 Aug at 18:12
.net core 2.1.3 ssl error
Hello guys right now I am using .net core 2.1.3 when I install webapi project by "dotnet new webapi" when I try to open by firefox or chrome it gives me this error > HttpsConnectionAdapter[1] Fail...
When should Task.ContinueWith be called with TaskScheduler.Current as an argument?
We are using [this code snippet](https://stackoverflow.com/a/37529395/120955) from StackOverflow to produce a Task that completes as soon as the first of a collection of tasks completes successfully. ...
- Modified
- 17 Jul at 15:20
EF Core 2.1: Self-referencing entity with one to many relationship generates additional column
I have the following entity: ``` public class Level { public int LevelId { get; set; } public int? ParentLevelId { get; set; } public string Name { get; set; } public virtual Level P...
- Modified
- 25 Dec at 09:55
Optimize cache with multiple keys in c# - remove duplication of objects
I have a project in Asp.Net Core. This project has a ICacheService as below: ``` public interface ICacheService { T Get<T>(string key); T Get<T>(string key, Func<T> getdata); Task<T> Get<...
- Modified
- 21 Jul at 11:5
How can I use a Service Model from ServiceStack 4.0 in a ServiceStack 5.0 Project?
I have begun the process of migrating one of our many ServiceStack services from .Net Framework to .Net core. Most of the migration has been relatively smooth, but I have run into a brick wall with Se...
- Modified
- 12 Jul at 19:26
How to use Span in Convert.TryFromBase64String()?
I was trying to write some `try catch` for `Convert.FromBase64String()` and I found out that it already has `TryFromBase64String()` method. But it needs 3 arguments: ``` public static bool TryFromBas...
get current date with 'yyyy-MM-dd' format in Angular 4
How i can get the current date with a specific format 'yyyy-MM-dd', for today by example i with that the result be: '2018-07-12', with using just the command ``` myDate = new Date(); ``` thanks a l...
- Modified
- 12 Jul at 07:42
C# IL code optimization: conditional operator (?:) and re-assignment of same variable
I was reading C# 7.0 changelog and ran into an example that shows new tuples syntax. ``` private static (int Max, int Min) Range(IEnumerable<int> numbers) { int min = int.MaxValue; int max = ...
- Modified
- 12 Jul at 05:37
Xamarin.UITesting NU1201 Error: Android 8.1 Is incompatible with .NETFramework 4.6.1
Have been having a little issue for the last couple of days now where I will create a new Xamarin Forms project on Visual Studio 2017 and add a Xamarin.UITest Cross-Platform Test Project for unit test...
- Modified
- 12 Jul at 03:29
Use same ss-id cookie across all subdomains - ServiceStack
In my Auth API set the ss-id cookie domain to be used for all subdomains like so in my AppHost.Configure method: ``` Config = new HostConfig { RestrictAllCookiesToDomain = ".mywebsite.com" }; ...
- Modified
- 11 Jul at 23:31
Get a UnityEngine.UI.Images position in screenSpace and calculate a normalised offset (inside an overlay canvas)
Simplified > Given an UnityEngine.Ui.Image How does one find the X,Y position of a normalised offset (like 0.4, 0.3 from the top left) inside that image in ScreenSpace units like 400,300 I guess I ne...
How to clear text field before sending keys selenium c#
I'm writing a simple selenium test which sends an incorrect string of letters then submits and returns and error. I want to then send a string of letter but this time with the correct string so it is ...
- Modified
- 16 May at 18:35
How to upgrade Python version to 3.7?
I have python3.5 already in linux ubuntu. I have downloaded the python3.7.tar [www.python.org](http://www.python.org). But i have no idea how to install it. How to upgrade to python 3.7? Thanks.
- Modified
- 11 Jul at 07:40
HttpClient best practices in Azure Functions
I need to build an Azure Function that: - `HTTP POST`- `HTTP HEAD` I've found some guidance [here](https://github.com/Azure/azure-functions-host/issues/1806) and [here](https://github.com/Azure/azur...
- Modified
- 11 Jul at 02:59
Unit test AuthorizationHandler
I used the resource-based authorization pattern in .NET Core 2.1 as described [here](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/resourcebased?view=aspnetcore-2.1&tabs=aspnetc...
- Modified
- 14 Feb at 19:53
C# project file - Why doesn't it represent what's in my project?
I am trying to understand the contents of a .csproj file after I converted from PCL to a .NET shared. Here is an example and some questions: ``` <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> ...
- Modified
- 13 Jul at 13:12
how to use C# dictionary in typescript?
I have dictionary objects in my c#. but I need to migrate to typescript. I am new to typescript. I really don't know, how to use dictionary in typescript. ``` LengthsByCountry = new Dictionary<stri...
- Modified
- 10 Jul at 13:40
What does a semi colon do after a conditional block in C#?
I recently came across this code in a project - which I assume was there by mistake: ``` if(condition) { //Whatever... }; ``` Note the semi colon after the closing brace. Does anyone know what ...
- Modified
- 16 Jul at 19:52
What's the difference between two attribute-based routing approaches: HttpGet("") and Route("")?
I was looking for information about attribute-based routing and found that there are two different attributes one can use: `HttpGet("")` and `Route("")`. However, I can't find any information about wh...
- Modified
- 28 Jan at 23:9
Image convolution in spatial domain
I am trying to replicate the outcome of [this link](https://stackoverflow.com/q/38709810/159072) using convolution in . Images are first converted to 2d `double` arrays and then convolved. Image an...
- Modified
- 14 Jul at 07:23
Add Username into Serilog
I have this Serilog configuration in ``` public class Program { public static IConfiguration Configuration { get; } = new ConfigurationBuilder() .SetBasePath(Directory.GetCur...
- Modified
- 3 Apr at 20:29