Questions

Converting IQueryable to implement IAsyncEnumerable

I have a query in a method: ``` private readonly IEntityReader<Customer> _reader; public async Task<IEnumerable<Customer>> HandleAsync(GetCustomer query) { var result = _reader.Query() ....

Group By Multiple Column In LINQ in C#

I have a class like as follows: ``` public class ActualClass { public string BookName { get; set; } public string IssuerName { get; set; } public DateTime DateOfIssue { get; set; } pu...

1 Jan at 10:37

How to find child of a GameObject or the script attached to child GameObject via script

I know this is a bit of a stupid question, but how would I reference the child (a cube) of a game object via script(the script is attached to the gameObject). (the equivalent to something like GetComp...

22 Nov at 23:6

How can I wrap Web API responses(in .net core) for consistency?

I need to return a consistent response with a similar structure returned for all requests. In the previous .NET web api, I was able to achieve this using DelegatingHandler (MessageHandlers). The objec...

17 Jan at 08:38

Task could not be loaded from assembly

I have an error in one of my projects at work. The error says: > Severity Code Description Project File Line Suppression State Error The "StyleCopTask" task could not be loaded from t...

22 Nov at 15:24

How to do gracefully shutdown on dotnet with docker?

Is there a way to shut-down a application which is running in ? If yes, which event I should listen? All I want is upon cancellation request I would like to pass my cancellation token/s to curre...

23 May at 11:54

Entity Framework not working with temporal table

I'm using database first entity framework 6. After changing some of the tables in my schema to be temporal tables, I started getting the following error when attempting to insert new data: `Cannot i...

Merge migrations in entity-framework-core

Is it possible to merge all migrations files into one ? I created initial migration. ``` dotnet ef migrations add InitialMigration ``` [Source](http://benjii.me/2016/05/dotnet-ef-migrations-for-as...

WPF FormattedText rasterises/cuts when ligatures used in some fonts (ti, tf, etc.)

I'm currently using the font [Carlito](https://fontlibrary.org/en/font/carlito) to render some `FormattedText` in WPF, in order to then print an eventual image as so: ``` DrawingVisual vis = new Dr...

22 Nov at 10:55

Deserializing JSON response without creating a class

From the result of an API call I have a large amount of JSON to process. I currently have this ``` Object convertObj = JsonConvert.DeserializeObject(responseFromServer); ``` I am aware that I coul...

22 Nov at 05:5

UserAuthId property not set when mocking a user session in ServiceStack

I'm trying to mock the user session in a BasicAppHost for testing as follows: ``` TestMode = true; container.Register<IAuthSession>(c => new AuthUserSession { UserAuthId = "1"...

21 Nov at 23:45

Entity Framework Core Customize Scaffolding

I have done scaffolding of my SQLServer database. And it creates the POCO objects in the specified folder. What i would like to do is that it extends from my base class. I also use repository pattern ...

3 Oct at 13:33

ServiceStack Docker architecture

I'm wondering if anyone with bigger brains has tackled this. I have an application where each customer has a separate webapp in Azure. It is Asp.net MVC with a separate virtual directory that houses...

Could not determine JSON object type for type "Class"

I got the following error while trying to add an object of type class to the . > Could not determine JSON object type for type "Class" Here is my code: ``` private dynamic _JArray = null private JArr...

20 Apr at 13:26

elasticache -ERR unknown command 'PSYNC

Trying to make AWS-Elasticache Redis3.2 as the Master and the redis instances in my EC2 as slaveof for this elasticache. I get this error. ``` Connecting to MASTER masterredis.XXXXXXXXXXXXXXXXXXX.ama...

Reportviewer tool missing in visual studio 2017 RC

I just started to write reporting software in new version of visual studio named visual studio 2017 RC but just noticed that core reportviewing tools is missing from both windows forms and WPF applica...

Difference between enabled, isActiveAndEnabled and activeInHierarchy in Unity

I cannot believe that this question has not already been asked somewhere; a fairly thorough Googling has turned up no results. The Unity documentation says this about the [Behaviour.isActiveAndEnable...

2 Feb at 16:17

The entity type 'IdentityUserLogin<string>' requires a primary key to be defined

i am using dotnet core 1.1 on linux, and i am having issues when i want to split up the identityContext from my regular dbContext, whenever i run the following line in my startup.cs --> configure: ``...

Custom mapping in Dapper

I'm attempting to use a CTE with Dapper and multi-mapping to get paged results. I'm hitting an inconvenience with duplicate columns; the CTE is preventing me from having to Name columns for example. ...

2 Dec at 20:38

Count incorrect in MongoDB

### Tech: - - - > mongodb://USER:PASS@MYMONGO1.com:1234,MYMONGO2.com:1234/DB_NAME?replicaSet=REPLICA_SET_NAME ### Assumptions - - - - - Once a day I log a specific count on this collection (sa...

20 Jun at 09:12

Can I open two solutions with Visual Studio for Mac at the same time?

That's it. Can this be initiated two times to open two separated solutions at the same time?

21 Apr at 18:54

What is the format for credentials in ServiceStacks JsonServiceClient?

I'm attempting to use ServiceStack's typescript JsonServiceClient, and it works fine with routes that don't require authentication, but I can't find any documentation on how to use it with authenticat...

19 Nov at 23:12

Returning a Dictionary<string, string> from a linq query

I have a table with 2 columns defined as varchar(50): Column1 and Column2. I want to return a dictionary of `<string, string>` where each row is in the dictionary and where Column1 is the key and Colu...

8 Sep at 09:31

Entity Framework - async select with where condition

I'm using ASP.NET Core with Entity Framework. First I select an employee, and then all employees that satisfy a condition (for the purpose of displaying what works): ``` var a = db.Employee.FirstOrD...

C#, is there 'Defer Call' like golang?

golang support 'Defer Call' and when c++, I use this trick(?). ``` struct DeferCall { DeferCall() {} ~DeferCall() { doSomeThing(); } } void SomeMethod() { DeferCall deferCall; ... } `...

19 Nov at 08:6