Questions

How to return a proper Promise with TypeScript

So I am learning Angular 2 with typescript. I am reaching a point to write a mocking service which (I believe) should return a Promise if the service get the Object Successfully and Return an Error i...

18 Aug at 15:13

How to validate white spaces/empty spaces? [Angular 2]

I would like to avoid white spaces/empty spaces in my angular 2 form? Is it possible? How can this be done?

28 Sep at 21:11

Drop database if model changes in EF Core without migrations

In previous version of entity framework, one could recreate the database if the model changes, using some of the classes DropDatabseIfModelChanges and other related classes. In EF7 or EF Core i don't...

Method overloading and inheritance

I have the following classes: ``` public class BaseRepository { public virtual void Delete(int id) { Console.WriteLine("Delete by id in BaseRepository"); } } public class EFRepos...

30 Aug at 17:55

How do I access Configuration in any class in ASP.NET Core?

I have gone through [configuration documentation](https://docs.asp.net/en/latest/fundamentals/configuration.html#) on ASP.NET core. Documentation says you can access configuration from anywhere in the...

6 Sep at 09:46

Kubernetes API - Get Pods on Specific Nodes

Reading the [Kubernets documentation](http://kubernetes.io/docs/user-guide/labels/#selecting-sets-of-nodes) it looks to be possible to select a certain range of pods based on labels. I want to select ...

26 Jan at 00:7

.NET Core publishing to IIS problems - 403.14

I am trying to publish a Core 1.0 app to a 2012R2 box that runs fine locally in IIS Express. - - - - - All I get is: > HTTP Error 403.14 - ForbiddenThe Web server is configured to not list the conten...

20 Jun at 09:12

Disable Chrome strict MIME type checking

Is there any way to disable `strict MIME type checking` in Chrome. Actually I'm making a JSONP request on cross domain. Its working fine on Firefox but, while using chrome its giving some error in co...

C# List all files with filename under an amazon S3 folder

Using C# and amazon .Net SDK, able to list all the files with in a amazon S3 folder as below: ``` ListObjectsRequest request = new ListObjectsRequest(); request.BucketName = _bucketName; //...

6 Aug at 10:16

Upload a file to an FTP server from a string or stream

I'm trying to create a file on an FTP server, but all I have is either a string or a stream of the data and the filename it should be created with. Is there a way to create the file on the server (I d...

30 Aug at 12:2

Path to LocalAppData in ASP.Net Core application

I have an ASP.Net Core application, and for the current purposes I've got to use LocalAppData. Usually I would write `Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)`, but u...

31 Aug at 07:45

How to force Newtonsoft Json to serialize all properties? (Strange behavior with "Specified" property)

Fellow programmers, I've encountered a strange behavior in Newtonsoft.Json. When I'm trying to serialize an object looking like this: ``` public class DMSDocWorkflowI { [JsonProperty("DMSDocWork...

30 Aug at 09:23

Multiple RUN vs. single chained RUN in Dockerfile, which is better?

`Dockerfile.1` executes multiple `RUN`: ``` FROM busybox RUN echo This is the A > a RUN echo This is the B > b RUN echo This is the C > c ``` `Dockerfile.2` joins them: ``` FROM busybox RUN echo This...

24 Dec at 01:26

Maximum number of Threads available to Tasks

I'm Trying to get my head around the async-await functionality within C#. I've written the below code to run several tasks asynchronously - currently all they do is raise an event after a certain amou...

Method Overloading with Optional Parameter

I have a class as follows with two overload method. ``` Class A { public string x(string a, string b) { return "hello" + a + b; } public string x(string a, string b, string c...

30 Aug at 05:36

Get Name of User from Active Directory

I need to show only the name of a user from Active Directory, I am using ``` lbl_Login.Text = User.Identity.Name; //the result is domain\username ``` This shows the users name but not the real nam...

2 Feb at 15:36

Export the dataGridView to Excel with all the cells format

I have this code that I know that it works fast ``` CopyAlltoClipboard(dataGridViewControl); Microsoft.Office.Interop.Excel.Application xlexcel; Microsoft.Office.Interop.Excel.Workbook xlWorkBook; Mi...

Bind UWP ComboBox ItemsSource to Enum

It's possible to use the `ObjectDataProvider` in a WPF application to bind an enum's string values to a ComboBox's ItemsSource, as evidenced in [this question](https://stackoverflow.com/questions/6145...

23 May at 12:10

How to override Custom Papersize in C#

I'm working on a project in C#. I have a labelprinter which needs to print a document that I send. The printer prints, however, I'm not able to override the following values of the `Custom` Paper form...

20 Oct at 08:30

Is this the proper way to convert between time zones in Nodatime?

The goal is to create a function that converts a time from one timezone to another properly using Nodatime. I'm not just looking for feedback on whether the result appears correct, but feedback speci...

29 Aug at 20:25

How to secure generated API documentation using swagger swashbuckle

I have implemented API documentation using swagger swashbukle. Now I want to publish generated documentation as a help file in my website. How to secure this link and publish?

How many bytes get allocated for 3 Point structs on a 64-bit processor?

There is a question: > Given:``` struct Point {int x; int y;} var p = new Point[3] ``` how many bytes of memory will be allocated in stack and in heap if we use a 64-bit processor? The correct answer ...

20 Jun at 09:12

How to Use MVC Controller and WebAPI Controller in same project

I am trying to use an MVC Controller and a Web API controller in the same project, but I get 404 errors for the Web API. I started the project as an MVC project in VS 2015, but then added the Web API ...

What is the equivalent of [Serializable] in .NET Core ? (Conversion Projects)

In many cases, when I want to convert current .NET Framework projects to .NET Core equivalent, some classes have . What should I do for convert them in .NET Core ? (In this time I delete them !!!) ...

29 Aug at 05:45

Linq performance: should I first use `where` or `select`

I have a large `List` in memory, from a class that has about 20 `properties`. I'd like to filter this list based on just one `property`, for a particular task I only need a list of that `property`. ...