Linq All on empty collection
I need to check if all definitions contains some specific data. It works fine except the case when GroupBy returns empty collection. ``` var exist = dbContext.Definitions .Where(...
- Modified
- 20 Aug at 09:46
Transforming Open Id Connect claims in ASP.Net Core
I'm writing an ASP.Net Core Web Application and using `UseOpenIdConnectAuthentication` to connect it to IdentityServer3. Emulating their ASP.Net MVC 5 sample I'm trying to transform the claims receive...
- Modified
- 17 Jul at 03:26
Can I directly stream from HttpResponseMessage to file without going through memory?
My program uses `HttpClient` to send a GET request to a Web API, and this returns a file. I now use this code (simplified) to store the file to disc: ``` public async Task<bool> DownloadFile() { v...
- Modified
- 1 Nov at 16:24
GetOwinContext is not working in asp.net core
It always says not include the define of GetOwinContext(),I try to download the .net core owin but I don't know how to implement the same function. The code belows can be complied in asp.net 5 . ```...
- Modified
- 19 Aug at 06:45
Factory Pattern with Open Generics
In ASP.NET Core, one of the things you can do with Microsoft's dependency injection framework [is bind "open generics"](https://stackoverflow.com/questions/35342472/net-core-dependency-injection) (gen...
- Modified
- 1 Dec at 18:19
Is Service Stack's DTO pattern really helpful?
Well, I have used ServiceStack ORMLite in the past and now trying my hands on ServiceStack RESTful DTO pattern. I have used WCF/Web API in the past and to me having a service with different methods is...
- Modified
- 18 Aug at 23:53
When to use an API Controller vs MVC Controller
I am aware of the difference between a WEB API and MVC. I am also aware that in asp.net core 1.0 there is only one type of controller that handles both MVC and API. However, I have been watching a lo...
- Modified
- 18 Aug at 20:56
Servicestack Autoquery problems after update to 4.0.62
i have recently upgraded to ServiceStack v4.0.62 and now my project doesnt compile. I have change my AutoQuery to IAutoQueryData but then none of my .Where and .Select and so on works anymore. Pleas...
- Modified
- 18 Aug at 20:45
Update Claims values in ASP.NET One Core
I have a Web Application in MVC 6 (Asp.Net One Core), and I'm using Claims based authentication. In the Login method I set the Claims: ``` var claims = new Claim[] { new Claim("Name", content.Nam...
- Modified
- 18 Aug at 20:38
Where to set <gcAllowVeryLargeObjects>?
I'm working on a little program on sorting lists. Now, I need an array that requires more than 2GB of RAM. During my research, I found the property, but I don't know where so set it. I'm using Mono. ...
ASP.NET Core API only returning first result of list
I have created a teams web api controller and trying to call the GET method to get the json result of all the teams in the database. But when I make the call I am only getting the first team back in t...
- Modified
- 18 Aug at 17:37
Load JSON string to HttpRequestMessage
I'm writing some tests for my WebAPI web service and cannot figure out how to send JSON to my service method in the test. ``` ScheduleRequest sr = new ScheduleRequest(); sr.Months = null; sr.States =...
- Modified
- 22 Aug at 21:28
The current status of System.Net.Http vs. Microsoft.Net.Http
I am confused with packaging of `HttpClient`. Earlier it was distributed as a part of `Microsoft.Http.Net` NuGet package while `System.Net.Http` was considered legacy. Looks like now it's the opposite...
- Modified
- 15 Apr at 21:14
geckodriver.exe not in current directory or path variable, Selenium 2.53.1 + Firefox 48 + Selenium 3 Beta
Seen a lot of questions regarding Selenium 2.53.1 and Firefox 47.0.1, but none in regards to the Selenium 3 Beta release. I am attempting to use the new gecko/marionette Firefox webdrivers, but even t...
- Modified
- 18 Aug at 10:54
Combine Expressions instead of using multiple queries in Entity Framework
I have following generic queryable (which may already have selections applied): ``` IQueryable<TEntity> queryable = DBSet<TEntity>.AsQueryable(); ``` Then there is the `Provider` class that looks l...
- Modified
- 24 Aug at 09:53
Problems with servicestack and typelinks
I have problems with gerenating types, it returns error 500 - InvalidDataException I can't understand whats wrong as my project builds fine and API works. None of the types works except the metadat...
- Modified
- 20 Aug at 19:19
vcruntime140.dll vs vcruntime140d.dll
What are the difference between these two dlls and ? Why do we need them? Are they both part of the Microsoft Visual C++ 2015 Redistributable? Have googled for quite some time, but couldn't find any...
connect to Postgresql with SSL
I am attempting to connect to a postgresql database which uses SSL via my c# application. But I'm unable to work out what the correct connection string would be. Is anyone able to help? ``` NpgsqlCon...
- Modified
- 18 Aug at 03:22
Is .GetAwaiter().GetResult(); safe for general use?
I read in a few places that `.GetAwaiter().GetResult();` could cause deadlocks and that we should use `async`/`await` instead. But I see many code samples where this is used. Is it ok to use it? Which...
- Modified
- 28 May at 18:36
How to set Entity Framework Core migration timeout?
I'm using the latest (1.0.0) version of EF Core. I have a migration to run on a quite big database. I run: > dotnet ef database update -c ApplicationDbContext And get: > Timeout expired. The time...
- Modified
- 18 Aug at 08:21
ASP.NET Core Request Localization Options
Here is my custom request culture provider which returns "en" as a default culture if no culture specified in url (for example `http://example.com/ru` or `http://example.com/en`). My idea to show webs...
- Modified
- 27 Jan at 10:19
ASP.NET Core initialize singleton after configuring DI
So let's say I have a singleton class instance that I register in the DI like this: ``` services.AddSingleton<IFoo, Foo>(); ``` And let's say the `Foo` class has a number of other dependencies (mos...
- Modified
- 8 Jul at 22:50
What is the appropriate project architecture for large scale ServiceStack/.NET projects?
We are in the design phase of setting up an internal enterprise API layer for our company. We are hoping to realize an API that can serve our internal apps as well as our external clients. Our environ...
- Modified
- 23 May at 11:51
Entity Framework - The migrations configuration type was not be found in the assembly
I have multiple `DbContext`s in a C# project and I'm trying to enable migrations. When I specify the full command, i.e.: ``` Enable-Migrations -ContextTypeName Models.Account.AccountDetailDbContext ``...
- Modified
- 1 Aug at 20:41
Promise equivalent in C#
In Scala there is a Promise class that could be used to complete a Future manually. I am looking for an alternative in C#. I am writing a test and I want it to look it similar to this: ``` // var M...
- Modified
- 17 Aug at 13:44