Dynamically read properties from c# expando object
Currently I have the following method- I would like to replace `T` with expando object. But I can't read properties from an expando object. Is there any way to do it?
- Modified
- 5 May at 16:53
SerialPort.BaseStream.ReadAsync drops or scrambles bytes when reading from a USB Serial Port
I've added the sending code and an example of the received output I'm getting. --- I am reading data from a USB "virtual" serial port connected to an embedded system. I have written two methods...
- Modified
- 23 May at 12:33
Why does the compiler complain that 'not all code paths return a value' when I can clearly see that they do?
I'm trying to figure out why the compiler has a problem with this function. It gives me the "Not all code paths return a value" error, however I cannot see a situation where control-flow would pass to...
- Modified
- 21 Jan at 13:40
ConfigureAwait(false) vs setting sync context to null
I often see recommended for async library code, that we should use `ConfigureAwait(false)` on all async calls to avoid situations where the return of our call will be scheduled on a UI thread or a web...
- Modified
- 23 Jan at 21:56
Xamarin.Forms.Navigation.PopAsync() Does Not Pop Page
In Xamarin.Forms, when we use `Navigation.PopAsync()`, the page does not pop in iOS. After `PopAsync()` the same page remains.
- Modified
- 24 Apr at 16:47
Filtering a pyspark dataframe using isin by exclusion
I am trying to get all rows within a dataframe where a columns value is not within a list (so filtering by exclusion). As an example: ``` df = sqlContext.createDataFrame([('1','a'),('2','b'),('3','b...
- Modified
- 21 Jan at 14:22
What does purple underlines mean in visual studio editor?
I am facing some purple (or violet?) underlines in Visual Studio 2015 today, something I have never seen before. [](https://i.stack.imgur.com/gUqNc.jpg) I held the cursor over the text but nothing h...
- Modified
- 21 Jan at 03:18
Project not build in active configuration Visual Studio MacOS .net Core
I have created an Console Application(.Net Core) in Visual Studios MacOS Preview. In the project solution I don't see my program.cs also other things are not available it says [](https://i.stack.img...
- Modified
- 21 Jan at 12:21
Access to configuration without dependency injection
I was wondering if there was a way to access Configuration (Microsoft.Extensions.Configuration) without the use of dependency injection. Only examples I see are through constructor injection (using I...
Initialize a Map containing arrays in TypeScript
I want to make a `Map` where each member contains an array of strings. But how do I initialize and type it (in a single statement)? (naively) I tried this: ``` private _gridOptions:Map<string, Array<s...
- Modified
- 1 Oct at 16:13
ServiceStack OrmLite - Is it possible to do a group by and have a reference to a list of the non-grouped fields?
It may be I'm still thinking in the Linq2Sql mode, but I'm having a hard time translating this to OrmLite. I have a customers table and a loyalty card table. I want to get a list of customers and f...
- Modified
- 20 Jan at 16:55
How to implement the repository pattern the right way?
When implementing the repository pattern for my ASP.NET project, I encountered some problems on which I can't get my head around. So I have a few questions on how to implement the repository pattern t...
- Modified
- 21 Jan at 13:55
How to merge two lists and remove duplicates
Given I have two list like the following: ```csharp var listA = new List { "test1", "test2", "test3" }; var listB = new List { "test2", "test3", "test4" }; ``` I want a third list with: ``...
nginx: [emerg] "server" directive is not allowed here
I have reconfigured nginx but i can't get it to restart using the following config: conf: ``` server { listen 80; server_name www.example.com; return 301 $scheme://example.com$request_uri; } ...
- Modified
- 15 Dec at 08:18
What does the win/any runtime mean in .NET Core
I'm building a C# .NET core application and it is targeting the `net452` framework. When I publish I can specify a runtime (--runtime), if I don't specify any runtime it uses `win7-x64` (I assume tha...
- Modified
- 28 Nov at 05:53
Amazon S3 console: download multiple files at once
When I log to my I am unable to download multiple selected files (the WebUI allows downloads only when one file is selected): [https://console.aws.amazon.com/s3](https://console.aws.amazon.com/s3) ...
- Modified
- 20 Jan at 13:27
Visual Studio 2017: "Object reference not set to an instance of an object" while loading the project
I have a project inside the VS solution that loads correctly in VS2015, but it seems to be corrupted in VS2017 (RC2). In the solution explorer it shows that its "load failed" and when I try to reload...
- Modified
- 20 Jan at 08:36
How to convert result table to JSON array in MySQL
I'd like to convert result table to JSON array in MySQL using preferably only plain MySQL commands. For example with query ``` SELECT name, phone FROM person; | name | phone | | Jack | 12345 | | Joh...
- Modified
- 20 Jun at 22:25
How to do String.Copy in .net core?
In porting a .net framework app to .net core app, there are some uses of [String.Copy](https://msdn.microsoft.com/en-us/library/system.string.copy(v=vs.110).aspx) to copy strings. But it looks this me...
Show only selected controllers in swagger-swashbuckle UI
I am currently using swagger in my project and i have more than 100 controllers there. I guess due to the large number of controller, swagger UI documentation page takes more than 5 min to load its c...
- Modified
- 20 Jan at 07:7
Use SQL LIKE operator in C# LINQ
I am building up a query in C#. For integer and string fields, case is quite simple. For date fields, I am using following query: ``` list.Where("myDateColumn >= DateTime(2017,1,20)"); ``` How I ca...
golang convert "type []string" to string
I see some people create a `for` loop and run through the slice as to create a string, is there an easier way to convert a `[]string` to a `string`? Will `sprintf` do it?
- Modified
- 25 Sep at 10:5
What's the difference between Content and None when "Always copy to output directory" is set?
In csproj file, we can include a file using either `None` or `Content` element. From MSDN, it says that: > None - The file is not included in the project output group and is not compiled in the bui...
- Modified
- 20 Jan at 01:25
Replacing a character from a certain index
How can I replace a character in a string from a certain index? For example, I want to get the middle character from a string, like abc, and if the character is not equal to the character the user spe...
- Modified
- 31 May at 21:46
C# get value from deserialized json object
I'm currently Deserializing a json string using the Newtonsoft.Json nuget packet using the following code: ``` var data = (JObject)JsonConvert.DeserializeObject(json); ``` Now I'm receiving an obje...