Questions

Using IReadOnlyCollection<T> instead of IEnumerable<T> for parameters to avoid possible multiple enumeration

My question is related to [this one](https://stackoverflow.com/q/24880268/197591) concerning the use of `IEnumerable<T>` vs `IReadOnlyCollection<T>`. I too have always used `IEnumerable<T>` to expose...

How to use LINQ to find a sum?

I have this structure: ``` private readonly Dictionary<string, Dictionary<string, int>> _storage = new Dictionary<string, Dictionary<string, int>>(); ``` key: Firmware(string): key: Device(stri...

21 Dec at 12:11

EF Core: Using ID as Primary key and foreign key at same time

I have two entities, `Prospect` and `Person`, what I'm trying to do is use `Prospect.ID` as the primary key on `Prospect` table and as the foreign key of `PersonID`, my idea is use the same ID for bot...

How to select records where field is missing from an Azure Storage Table?

I'm attempting to process records that were inserted into Azure Table Storage prior to the addition of a new attribute. The [LINQ support is limited](https://learn.microsoft.com/en-us/rest/api/storage...

21 Dec at 12:0

C# how to "register" class "plug-ins" into a service class?

All these years have passed and still no good answer. Decided to [revive](https://stackoverflow.com/questions/73537998/c-sharp-how-to-register-class-plug-ins-into-a-service-class-as-of-today) this qu...

1 Sep at 07:7

Floating point division returns integer numbers

I want to calculate the average of two floating point numbers, but whatever the input, I am getting an integer returned. What should I do to make this work? ``` public class Program { public sta...

21 Dec at 10:0

Configure launchSettings.json for SSL in debug - ASP.NET Core / Visual Studio Code

I am following [this](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/index) tutorial to add Facebook authentication to my web app. As part of the process I am trying to ...

pandas - find first occurrence

Suppose I have a structured dataframe as follows: ``` df = pd.DataFrame({"A":['a','a','a','b','b'], "B":[1]*5}) ``` The `A` column has previously been sorted. I wish to find the ...

31 Jan at 08:51

Anonymous Types C#

I understand that anonymous types have no pre-defined type of its own. Type is assigned to it by the compiler at the compile type and details of type assigned at compile time can't be known at code le...

27 May at 09:47

Is it true that async should not be used for high-CPU tasks?

I was wondering whether it's true that `async`-`await` should not be used for "high-CPU" tasks. I saw this claimed in a presentation. So I guess that would mean something like ``` Task<int> calculat...

20 Dec at 16:13

Entity Framework Core add unique constraint code-first

I can't find way to add a unique constraint to my field with using attribute: ``` public class User { [Required] public int Id { get; set; } [Required] // [Index("IX_FirstAndSecond",...

DTO vs. Domain Model, project organization

I have a project with a repository, a service layer, using EF6 and code-first POCOs. In the CustomerRepository, I am doing several projection queries that return objects. I understand that the code-fi...

ServiceStack DateTime Handling

I am having a problem with the DateTime format that is being utilized by ServiceStack. For example I have a simple request object like this. ``` public class GetAllUpdatedStudents : IReturn<GetAll...

20 Dec at 14:27

Simple Injector: Register ILogger<T> by using ILoggerFactory.CreateLogger<T>()

I'm working with a project which utilizes Simple Injector as dependency injector. On the other hand, this project uses Microsoft.Extensions.Logging in order to log the events that occurs in certain cl...

Visual Studio 2015 generate UML from code

- - I have a almost finished project and now I need to write a documentation. I found some information in the www which tells to "simply" generate UML from the existing code. At the top Menu is a ...

Outlook SMTPClient server error 5.3.4 5.2.0

I have an MVC .NET web application that has been running stable for the most part of a year now. However today we received an error code and I'm having trouble finding how to resolve the issue. In t...

4 Jun at 18:23

MVC4: After server restart, cannot post ajax internal server error 500

I am building an MVC application. It behaves so weird. If I run it on my development server (visual studio debugging) it runs fine even when I restart my application several times by changing the web....

React Child Component Not Updating After Parent State Change

I'm attempting to make a nice ApiWrapper component to populate data in various child components. From everything I've read, this should work: [https://jsfiddle.net/vinniejames/m1mesp6z/1/](https://jsf...

20 Dec at 01:10

Cloning specific branch

I am new to git version control and I dont know how to clone / pull a specific branch of a repo . Trying to get the branch `master` of the project, but it defaults to branch `test_1` I have tried usi...

20 Dec at 01:0

Update entity class in ASP.NET Core Entity Framework

I have created the model from existing database using Entity Framework in ASP.NET Core. Here is the model of the `Market` table ``` public partial class Market { public Guid MarketId { get...

How to comment code in a vue.js file?

I have the need to insert a comment inside a vue.js file for future references, but I don't find how you do this in the docs. I have tried `//`, `/**/`, `{{-- --}}`, and `{# #}`, but none of them see...

19 Dec at 18:38

Asp.Net Identity with 2FA: List of Trusted Browsers

I'm working on a project with Asp.Net MVC 5 and Asp.Net Identity and I'm using two factor authentication. For the login I use: `var result = await SignInManager.TwoFactorSignInAsync(model.Provider, mo...

Can ServiceStack OrmLite set a a property with a non-public setter?

Is there any way to make ServiceStack OrmLite set a property when its setter is not public? This would be very useful for keeping the class safer to use in some cases, e.g. when there are 2 dependent ...

19 Dec at 16:46

ServiceStack.OrmLite fails if condition has subquery

I'm using `ServiceStack.OrmLite` v4.0.62 because of .NET Framework 4.0. I need to perform search functionality. As my POCO classes have deep hierarchy, I need to use LINQ queries with nested subquerie...

19 Dec at 13:57

Observable.Generate with TimeSpan selector appears to leak memory [When using a TimeSpan > 15ms]

I am investigating the use of Observable.Generate to create a sequence of results sampled at intervals using the examples from the msdn website as a starting point. The following code WITHOUT a TimeS...

20 Dec at 14:18