HttpConfiguration does not contain a definition for SuppressDefaultHostAuthentication
I created an ASP.NET-WebApi application and I've got this error: > HttpConfiguration does not contain a definition for SuppressDefaultHostAuthentication The code was auto-generated, I think it has ...
- Modified
- 15 Aug at 01:8
Servicestack - OR operator for consuming autoquery rdbms API
Is there a way to use OR operator for conditions in queries. I know that the modifier `[QueryDbField(Term=QueryTerm.Or)]` can be used but this will change the behavior of the property always. Maybe so...
- Modified
- 18 Nov at 20:14
Proper way of testing ASP.NET Core IMemoryCache
I'm writing a simple test case that tests that my controller calls the cache before calling my service. I'm using xUnit and Moq for the task. I'm facing an issue because `GetOrCreateAsync<T>` is an e...
- Modified
- 18 Nov at 19:25
Servicestack object parameter not getting passed to service with Swagger-UI
My service model: ``` [Route("/customer/{CustomerId}/creditcardtoken/{CanLookup}", "POST")] public class CreditCardToken : IReturn<CreditCardTokenResponse> { [ApiMember(ParameterType = "path", Da...
- Modified
- 18 Nov at 18:43
Pattern match variable scope
In the [Roslyn Pattern Matching spec](https://github.com/dotnet/roslyn/blob/features/patterns/docs/features/patterns.md#scope-of-pattern-variables) it states that: > The scope of a pattern variable i...
- Modified
- 18 Nov at 15:31
Servicestack Ormlite multi-column constraint fails where constraint includes Enum
I am using ServiceStack.Ormlite, and also make heavy use of the automatic handling of enums whereby they are stored in the db as strings but retrieved and parsed nicely back into Enums on retrieval, s...
- Modified
- 23 May at 12:13
Which exceptions can HttpClient throw?
I am using [HttpClient](https://msdn.microsoft.com/de-de/library/system.net.http.httpclient(v=vs.118).aspx) in a xamarin forms project The class is documented, but I can not find any documentation ab...
- Modified
- 18 Nov at 13:6
VS 2015 SSIS Script Tasks cannot be debugged
Just spent hours pulling my hair trying to work out why my ssis Script Component was not breaking into debugger on hitting a breakpoint. I searched the web and fund 64 bit setting (Project -> Properie...
- Modified
- 30 Oct at 20:44
What is the difference between "x is null" and "x == null"?
In C# 7, we can use ``` if (x is null) return; ``` instead of ``` if (x == null) return; ``` Are there any advantages to using the new way (former example) over the old way? Are the semantics any di...
- Modified
- 21 Oct at 02:28
Reference operators in XML documentation
I would like to reference an operator in a `<see cref="..." />` [XML documentation](https://msdn.microsoft.com/en-us/library/b2s063f7.aspx) tag, but I can't seem to find any hints on how to do it. The...
- Modified
- 20 Jun at 09:12
Load* POCO references using OrmLite and SQL
I have a few questions about ServiceStack.OrmLite's POCO reference capabilities. 1. When using the Load*() API to fetch POCO with references, does it internally generate & run a single SQL query (wi...
- Modified
- 18 Nov at 08:25
How can I manually check the url authorization in MVC5?
To restrict the access to an web app, an Administrator is able to set the url authorization of users and groups via the IIS-Manager: [](https://i.stack.imgur.com/jJFvf.png) The IIS-Manager store...
- Modified
- 22 Nov at 14:42
ASP.NET Core Select Helper Throws Object Reference not set to an instance of an Object
I've created an ASP.NET Core web application that uses Entity Framework Core to read from my existing database. I want to populate a select control with a list of FacilityNames in a view to create a ...
- Modified
- 18 Nov at 00:24
Unrecognized C# syntax
Let's say we have: ``` class Foo { public int IntPropertyInFoo { get; set; } public Bar BarPropertyInA { get; set; } } class Bar { public string StringPropertyInBar { get; set; } } ``` ...
Prompt file download
I have a link on my page on click of which I am trying to generate a PDF document and then show the "Open - Save" prompt on the browser. My HTML (reactjs component) has the below code where `onclick`...
- Modified
- 13 Oct at 19:47
SqlConnection.Open vs SqlConnection.OpenAsync - what's different between the two beyond the obvious?
This boils down to why does changing just SqlConnection.Open() to await SqlConnection.OpenAsync() within asynchronous code result in strongly different behavior. What's the difference between a SqlC...
- Modified
- 17 Nov at 20:40
Update claims in ClaimsPrincipal
I am using Adal with Azure Active Directory and I need to add extra claims via custom OwinMiddleware. When I add claims to this principal, I am able to access them in the current request. But after a ...
- Modified
- 18 Nov at 15:27
AutoMapper - What's difference between Condition and PreCondition
Suppose a mapping using AutoMapper like bellow: ``` mapItem.ForMember(to => to.SomeProperty, from => { from.Condition(x => ((FromType)x.SourceValue).OtherProperty == "something"); from.MapFro...
- Modified
- 14 Feb at 13:10
How to add Persistent Listener to Button.onClick event in Unity Editor Script
I am trying to do a simple thing: 1. Create a new GameObject 2. Add a Button component to the GameObject. 3. Add a persistent Listener to Button's OnClick event. The method I am trying to register ...
Register Service at Runtime via DI?
I am using ASP.NET Core and want to add a service to the IServiceProvider at runtime, so it can be used across the application via DI. For instance, a simple example would be that the user goes to th...
- Modified
- 17 Nov at 13:27
How to stop Chrome's Select a certificate window?
I'm working on a Selenium project and the system I need to test is using an SSL certificate. Every time when I try to login we are getting this "Select a certificate" window which we cannot handle wit...
- Modified
- 21 Jan at 01:47
What is the difference between Microsoft.Spatial and System.Spatial libraries
I would like to know what is the difference between two spatial libraries - Microsoft.Spatial and System.Spatial? When I'm looking into the code of those two I see almost the same classes. Both has f...
- Modified
- 17 Nov at 10:13
How do I declare a C# anonymous type without creating an instance of it?
Is there a better way that can I declare an anonymous type, without resorting to create an instance of it? ``` var hashSet = new [] { new { Name = (string)null } }.Take(0).ToHashSet(); // HashSet<T>...
- Modified
- 17 Nov at 11:30
Performance: .Join vs .Contains - Linq to Entities
I am using Linq to entities to query the database to get the list of int for further processing. I have two ways to get the list as below: ``` List<int> lstBizIds = new List<int>() { 1, 2, 3, 4, 5 ...
- Modified
- 17 Nov at 09:32
Type or namespace name Mock<> could not be found Entity Framework 6
I am trying to mock my `DbContext` for writing my unit tests. I saw a tutorial, and tried to do it like the following: ``` [TestMethod] public void MyFirstTest() { var mockSet = new Mock<DbSet<V...
- Modified
- 10 Aug at 07:56