Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
I am getting runtime error > This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code.Description: An unhandled exception occurred during the...
- Modified
- 14 Jun at 15:9
How to manage the version number in Git?
Let's imagine the [blerp](http://xkcd.com/1692/) command line tool maintained on [git](/questions/tagged/git). This tool has the (hidden) `--version` option which returns its [version](https://en.wiki...
- Modified
- 2 Sep at 17:19
ASP.NET Core DependencyResolver
In ASP.NET MVC 5 is possible to obtain some dependency through `DependencyResolver.Current.GetService<T>()`. Is there something similar in ASP.NET Core?
- Modified
- 15 Mar at 02:59
Git - remote: Repository not found
I have SourceTree with local working copy. And all operations work good, I can simple fetch, push, pull and etc via SourceTree. I just needed to make force push which does not exist in SourceTree. I ...
- Modified
- 14 Jun at 13:31
Swashbuckle adding 200 OK response automatically to generated Swagger file
I am building swagger docs using Swashbuckle in my WebApi 2 project. I have the following definition of the method: ``` [HttpPost] [ResponseType(typeof(Reservation))] [Route("reservations")] [Swagge...
- Modified
- 14 Jun at 18:37
ServiceStack 4.0.60: How to modify/kill sessions if the default behaviour is to not persist them to cache?
In my existing application I am able to log out (destroy) sessions because I keep a list of session Id's associated to a user. This would allow me to provide functionality like "log out all other sess...
- Modified
- 20 Jun at 09:12
Check if a type belongs to a namespace without hardcoded strings
Is it possible to check if a type is part of a namespace without using harcoded strings? I'm trying to do something like: ``` Type type = typeof(System.Data.Constraint); if(type.Namespace == System....
- Modified
- 14 Jun at 12:31
async TryParse(...) pattern
There are a lot of common `bool TryXXX(out T result)` methods in the .NET BCL, the most popular being, probably, `int.TryParse(...)`. I would like to implement an `TryXXX()` method. Obviously, I can...
- Modified
- 15 Jun at 13:21
ServiceStack Serialize and Deserialize Dictionary with Objects
I have a very weird problem here pertaining to ServiceStack.Text's serializer. Suppose I have two classes, one called `Person` and another called `Address`. Person: ``` public class Person { p...
- Modified
- 14 Jun at 10:31
What is a complex type in entity framework and when to use it?
I have tried to read the msdn [article](https://msdn.microsoft.com/en-us/library/cc716799(v=vs.100).aspx) on complex types. But it does not explain when to use it. Also there is not a comprehensive ex...
- Modified
- 14 Jun at 07:56
Cookies in ASP.Net MVC 5
I am developing an application in which users are SignUp or SignIn by External Identity Providers like AAD, Google, WS-Federated Authentication etc. Now I want to create cookies on a user machine to l...
- Modified
- 2 Mar at 12:42
How do I resolve C# dependencies automatically?
I've been reading about Unity's dependency injection and I understand it's a thing and that it allows you to type a class to an interface. What I'm curious about is, do I HAVE to? In the below scena...
Ruby: What does the comment "frozen_string_literal: true" do?
This is the `rspec` binstub in my project directory. ``` #!/usr/bin/env ruby begin load File.expand_path("../spring", __FILE__) rescue LoadError end # frozen_string_literal: true # # This file was ...
- Modified
- 7 Mar at 23:2
Content Security Policy directive: "frame-ancestors 'self'
I am embedding an iFrame in my web page, something like this: ``` var iframeProps = { 'data-type': self.props.type, allowTransparency: self.props.allowTransparency, className:...
- Modified
- 13 Jun at 23:56
Display project version in ASP.NET MVC Core application (RC2)
How do I display application version from the project.json? I am using `gulp-bump` to autoincrement version, but I can't show the recent version. Here is what I'm trying: ``` @(Microsoft.Extensions.P...
- Modified
- 13 Jun at 20:6
How to hydrate a Dictionary with the results of async calls?
Suppose I have code that looks like this: ``` public async Task<string> DoSomethingReturnString(int n) { ... } int[] numbers = new int[] { 1, 2 , 3}; ``` Suppose that I want to create a dictionary ...
- Modified
- 13 Jun at 17:49
Serialize enum values as camel cased strings using StringEnumConverter
I'm trying to serialize a list of objects to JSON using Newtonsoft's JsonConvert. My Marker class includes an enum, and I'm trying to serialize it into a camelCase string. Based on other Stackoverfl...
- Modified
- 14 Sep at 09:53
Integer division in Java
This feels like a stupid question, but I can't find the answer anywhere in the Java documentation. If I declare two ints and then divide them, what exactly is happening? Are they converted to `floats/...
How to return HTTP 500 from ASP.NET Core RC2 Web Api?
Back in RC1, I would do this: ``` [HttpPost] public IActionResult Post([FromBody]string something) { try{ // ... } catch(Exception e) { return new HttpStatusCodeRe...
- Modified
- 14 Nov at 01:14
IE and Edge fix for object-fit: cover;
I'm using `object-fit: cover;` in my CSS for images on a specific page, because they need to stick on the same `height`. It works great in most browsers. But when scaling my browser in IE or Edge, t...
- Modified
- 13 Jun at 14:55
WPF + MVVM + RadioButton : How to handle binding with single property?
From [this](https://stackoverflow.com/questions/2284752/mvvm-binding-radio-buttons-to-a-view-model) and [this](https://stackoverflow.com/questions/883246/mvvm-radiobuttons) (and other) questions on St...
- Modified
- 2 Feb at 09:43
How to copy folders to docker image from Dockerfile?
I tried the following command in my Dockerfile: `COPY * /` and got mighty surprised at the result. Seems the naive docker code traverses the directories from the glob and then dumps the each file in t...
- Modified
- 13 Jun at 13:37
Type or namespace name 'Data' does not exist in the namespace 'System'
I'm trying to build my first ASP.NET Web Forms project but I'm facing some serious problem. I created two project files in my project named: BLL and DAL. I created classes named `class.cs` and `class1...
- Modified
- 30 Aug at 07:17
MongoDB C# Get all documents from a list of IDs
I have a list of Ids ``` List<string> Ids; ``` and I would like to retrieve all the documents matching these Ids. There are solutions on the web: ``` var ids = new int[] {1, 2, 3, 4, 5}; var quer...
"Object doesn't support property or method 'find'" in IE
``` <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></scr...
- Modified
- 16 Mar at 10:26