Create Unique constraint for 'true' only in EF Core
I have a class for tracking attachments to a Record. Each Record can have multiple RecordAttachments, but there is a requirement that there can only be one RecordAttachment per-Record that is marked a...
- Modified
- 27 Apr at 20:28
Equivalent of c# class virtual member in TypeScript
So in C# when I've been creating model classes and lazy loading things, I do something like this: ``` public int? User_ID { get; set; } public int? Dept_ID { get; set; } ``` Then a little farther d...
- Modified
- 20 May at 16:27
How to force hangfire server to remove old server data for that particular server on restart?
I am showing list of hangfire servers currently running on my page. I am running hangfire server in console application but the problem is when I don't have my console application running still hangf...
- Modified
- 30 Apr at 06:59
How to create a Kafka Topic using Confluent.Kafka .Net Client
It seems like most popular .net client for Kafka ([https://github.com/confluentinc/confluent-kafka-dotnet](https://github.com/confluentinc/confluent-kafka-dotnet)) is missing methods to setup and crea...
- Modified
- 27 Apr at 13:23
'IJsonHelper' does not contain a definition for 'Encode'
I want to convert a list of strings to a javascript array in my view, and I've found the below suggestion in a few places on the internet: ``` @model IEnumerable<DSSTools.Models.Box.BoxWhiteListUser>...
- Modified
- 27 Apr at 06:28
How to return XmlDocument as a response from a ServiceStack API
We are having a few ServiceStack APIs which are being called from an external tool. This tool expects the input of "XmlDocument" type, and there is no provision to write code to convert a string to Xm...
- Modified
- 26 Apr at 12:15
VS 2017 immediate window shows "Internal error in the C# compiler"
I use Visual Studio 2017 (15.6.6). When debugging, I try to evaluate simple expressions like `int a = 2;` in the immediate window. An error > Internal error in the C# compiler is thrown. I tried to...
- Modified
- 26 Apr at 09:32
Get defined Route from Dto
I've created a basic Dto Hit tracker that counts how many times a ServiceStack API is requested. What I'm trying to get now is the Route that was defined for the current Dto in the ServiceBase using R...
- Modified
- 26 Apr at 08:13
Find unused / unnecessary assemblyBinding redirects
It seems like there is so many binding redirects in our that I either: 1. look unnecessary 2. are for assemblies I don't see being referenced anywhere in our solution This is just a sample of so...
- Modified
- 26 Apr at 07:5
OrmLite (ServiceStack): Only use temporary db-connections (use 'using'?)
For the last 10+ years or so, I have always opened a connection the database (mysql) and kept it open, until the application closed. All queries was executed on the connection. Now, when I see exampl...
- Modified
- 26 Apr at 07:2
Difference between poll and consume in Kafka Confluent library
The github examples [page](https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/examples/AdvancedConsumer/Program.cs) for the Confluent Kafka library lists two methods, namely poll and c...
- Modified
- 9 Jan at 20:43
Servicestack autoquery custom convention doesn't work with PostgreSQL
I have defined new implicit convention ``` autoQuery.ImplicitConventions.Add("%WithinLastDays", "{Field} > NOW() - INTERVAL '{Value} days'"); ``` The problem is that for postgres connection the que...
- Modified
- 27 Apr at 13:26
Passing IHttpClientFactory to .NET Standard class library
There's a really cool `IHttpClientFactory` feature in the new ASP.NET Core 2.1 [https://www.hanselman.com/blog/HttpClientFactoryForTypedHttpClientInstancesInASPNETCore21.aspx](https://www.hanselman.co...
- Modified
- 1 Oct at 23:38
Network issues and Redis PubSub
I am using ServiceStack 5.0.2 and Redis 3.2.100 on Windows. I have got several nodes with active Pub/Sub Subscription and a few Pub's per second. I noticed that if Redis Service restarts while there ...
- Modified
- 25 Apr at 17:54
Servicestack as SSRS datasource
I am trying to use servicestack as a datasource for my SSRS report. Is this possible? Right now I have a simple operation that takes a date as a parameter, looks like this in C# ``` [DataContract] ...
- Modified
- 26 Apr at 19:20
Why isn't there an implicit typeof?
I think I understand why this small C# console application will not compile: ``` using System; namespace ConsoleApp1 { class Program { static void WriteFullName(Type t) { ...
- Modified
- 25 Apr at 01:0
The seed entity for entity type 'X' cannot be added because the was no value provided for the required property "..ID"
I'm playing wit . I have troubles with HasData (Seed) method in `OnModelCreating(ModelBuilder modelBuilder)` My model is simple POCO class that has no annotation. ``` public class Tenant { publi...
- Modified
- 10 May at 22:58
Using a C# 7 tuple in an ASP.NET Core Web API Controller
Do you know why this works: ``` public struct UserNameAndPassword { public string username; public string password; } [HttpPost] public IActionResult Create([FromBody]UserNameAndPassword use...
- Modified
- 20 Jan at 15:37
Understanding async / await and Task.Run()
I thought I understood `async`/`await` and `Task.Run()` quite well until I came upon this issue: I'm programming a Xamarin.Android app using a `RecyclerView` with a `ViewAdapter`. In my Method, I tr...
- Modified
- 8 May at 08:33
Get text from inside google chrome using my c# app
I am writing a small app that will among other things expand shortcuts into full text while typing. example: the user writes "BNN" somewhere and presses the relevant keyboard combination, the app woul...
- Modified
- 24 Apr at 13:34
Using LINQ expressions in Visual Studio's Watch window
I have a byte[] variable in program, e.g.: ``` byte[] myByteArray = new byte[] { 0xF0, 0x0F }; ``` When debugging this program, I wanted to display the byte array content as individual hexadecimal ...
- Modified
- 24 Apr at 08:24
Importing JSON file in TypeScript
I have a `JSON` file that looks like following: ``` { "primaryBright": "#2DC6FB", "primaryMain": "#05B4F0", "primaryDarker": "#04A1D7", "primaryDarkest": "#048FBE", "seconda...
- Modified
- 1 Apr at 16:31
Create a rounded button / button with border-radius in Flutter
I'm currently developing an Android app in Flutter. How can I add a rounded button?
- Modified
- 28 Feb at 16:56
Adding property to a json object in C#
I'm trying to add a property to a json object, which are not root of the json. example is below. after the operation, i want the json file to look like below. I have gotten to the point where I can ac...