Using Unity3D's IPointerDownHandler approach, but with "the whole screen"

In Unity say you need to detect finger touch (finger drawing) on something in the scene. The only way to do this : --- . Put a collider on that object. ("The ground" or whatever it may be.) O...

10 Apr at 14:49

What is the benefit of using "Expression Bodied Functions and Properties"

I do have seen many using that , but what is the benefit of using those expressions? ## Examples: ``` public override string ToString() => string.Format("{0}, {1}", First, Second); public string...

23 May at 12:33

Cannot find .cs files for debugging .NET source code

I tried setting up debugging the .NET source by following this [MDSN walkthrough](https://msdn.microsoft.com/en-us/library/cc667410.aspx). The Symbol cache is setup properly, as is the check 'Enable ....

18 Aug at 13:32

Is there an open source equivalent of ServiceStack AutoQuery for asp.net core?

I would like to know if there is an open source equivalent of AutoQuery From ServiceStack for `asp.net` core (or `asp.net`) which can automatic query with the orm i use: ef core (or other) with uris l...

Writing Unit Tests in Visual Studio Code

I am new to using the Visual Studio Code in place of visual studios and i feel a little lost to how i can set up my program to include unit test. I created a c# console app and i would like to creat...

29 Oct at 08:24

Failed to start redis.service: Unit redis-server.service is masked

I Installed Redis Server on ubuntu 16.04. but when I try to start the redis service using ``` $ sudo systemctl start redis ``` I receive message: ``` Failed to start redis.service: Unit redis-server...

IRedisClient GetTypedClient not found

I get error IRedisClient does not contain definition of GetTypedClient: ``` private readonly IRedisClient _redisClient; public CustomerRepository(IRedisClient redisClient) { _redisC...

28 Oct at 23:49

EF Core: ValueGeneratedNever() vs. not using this method at all

What is the point of explicitly telling entity framework not to generate a value for a field in a database? There are two other options which are `ValueGeneratedOnAdd` or `ValueGeneratedOnAddOrUpdate`...

Implement dependency injection outside of Startup.cs

I want to implement in . I know everything is about DI in .Net Core. For example ``` public void ConfigureServices(IServiceCollection services) { // Add application services. services....

Find method in current file/class in VS2015/C#

I can use the `Ctrl+,` shortcut to search for methods but will search among the entire project: [](https://i.stack.imgur.com/cVgi4.png) This lists all the classes in all files that have this method,...

AuthenticationManager.SignIn() isn't present in AuthenticationManager class

I'm trying to use the method from the `AuthenticationManager` class `SignIn()`; Here is how I'm doing it: But it says that `SignIn` doesn't exists there... The path to the `AuthenticationManager` is: ...

Authorize By Group in Azure Active Directory B2C

I am trying to figure out how to authorize using groups in Azure Active Directory B2C. I can Authorize via User, for example: ``` [Authorize(Users="Bill")] ``` However, this is not very effective a...

24 Jan at 21:13

Hooking IDbInterceptor to EntityFramework DbContext only once

The [IDbCommandInterceptor](https://msdn.microsoft.com/en-us/library/system.data.entity.infrastructure.interception.idbcommandinterceptor(v=vs.113).aspx) interface is not very well documented. And I'v...

How to programmatically assign roles and permissions to services and/or RequestDTOs

Statically I set access to my services like so: ``` [Authenticate] public class AppUserService : Service { [RequiredRole("Administrator")] public object Post(CreateAppUser request) { ...

28 Oct at 08:46

How can I downcast an instance generated by static method?

I have a problem with a C# program that includes the following : ``` class Program { static void Main(string[] args) { Child childInstance = Child.ParseFromA(@"path/to/Afile") as Chi...

28 Oct at 12:24

Can I use Content Negotiation to return a View to browers and JSON to API calls in ASP.NET Core?

I've got a pretty basic controller method that returns a list of Customers. I want it to return the List View when a user browses to it, and return JSON to requests that have `application/json` in the...

28 Oct at 23:37

ServiceStack OrmLite CustomSelect not working?

I'm trying to use the feature documented here : [https://github.com/ServiceStack/ServiceStack.OrmLite#custom-sql-customizations](https://github.com/ServiceStack/ServiceStack.OrmLite#custom-sql-customi...

31 Oct at 20:40

Understanding Decorator Design Pattern in C#

I just started to learn Decorator Design Pattern, unfortunately i had to go through various refrences to understand the Decorator pattern in a better manner which led me in great confusion. so, as far...

26 Jul at 12:38

How to Re-use HttpClient instance with different credentials per request

I have an MVC 5 application that includes a controller action that makes a HTTP request. To do this, I am using HttpClient. I have learnt from others (like this blog [post](http://aspnetmonsters.com/2...

20 Jun at 09:12

Simple but good example on how to use Dapper with Structuremap and dependency injection

I am trying to understand how to use Dependency Injection with Dapper (IDbConnection) and still being able to use built in dispose. I have found a couple of articles on the web but non that I think is...

How to Change DNS with C# on Windows

I'm trying to change the DNS on Windows. I have code that works on Windows 7, however it does not work on Windows 10. Here is my code for Windows 7 that changes the DNS: My question is, how do I get t...

7 May at 08:27

.NET HttpClient add query string and JSON body to POST

How do I set up a .NET HttpClient.SendAsync() request to contain query string parameters and a JSON body (in the case of a POST)? ``` // Query string parameters var queryString = new Dictionary<strin...

27 Oct at 17:37

Can't get claims from JWT token with ASP.NET Core

I'm trying to do a really simple implementation of JWT bearer authentication with ASP.NET Core. I return a response from a controller a bit like this: ``` var identity = new ClaimsIdentity(); ide...

How to not copy app.config file to output directory

I have a WPF application I am building. I am using Visual Studio Community 2015. In an effort to create a "true" release build, I am changing up some build settings so it only generates necessary fi...

How to update complex type field (json) using ormLite from servicestack

I am trying to update only one column with jsonb type. Insert works perfectly without any surprises but I can't find out how can I do update only one field with attribute [ComplextType('json')] db.Upd...

27 Oct at 15:11