ASP.NET Core Application Lifecycle
Is there any current "ASP.NET Core" document(s) about the life cycle? I would like to be able to tie into the life cycle at the right points. Is it similar to the existing ASP.NET MVC 5 life cycle? ...
- Modified
- 8 Nov at 11:37
When writing a PowerShell module in C#, how do I store module state?
I'm writing a PowerShell module in C# that connects to a database. The module has a `Get-MyDatabaseRecord` cmdlet which can be used to query the database. If you have a `PSCredential` object in the va...
- Modified
- 30 Sep at 20:31
Xamarin.Forms PCL & ServiceStack 4.5
I have a Xamarin.Forms PCL project, profile 7. I'm trying to troubleshoot some errors coming up when I try to create a new instance of JsonServiceClient: Searching for my errors, I discovered: ...
- Modified
- 30 Sep at 19:48
Does async await increases Context switching
I am aware of how async await works. I know that when execution reaches to await, it release the thread and after IO completes, it fetches thread from threadpool and run the remaining code. This way t...
- Modified
- 30 Sep at 16:0
How can I unit test a component that uses the Router in Angular?
In Angular 2.0.0, I am unit testing a component that uses Router. However I get the 'Supplied parameters do not match any signature of call target.' error. In Visual studio code in spec.ts it is the n...
- Modified
- 18 Dec at 20:56
Read appsettings json values in .NET Core Test Project
My Web application needs to read the Document DB keys from appsettings.json file. I have created a class with the key names and reading the Config section in `ConfigureServices()` as: ``` public Start...
- Modified
- 19 May at 08:2
How to pass a delegate or function pointer from C# to C++ and call it there using InternalCall
I have the following setup in C#: ``` public delegate void CallbackDelegate(string message); [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void setCallback(CallbackDelega...
Specify encoding when reading file from Resource
I have an UTF8 file, which I have added to my project in Resources.resx, called Template.txt If I read the file normally like this: string template = File.ReadAllText(@"filepath\Template.txt", Encod...
Best practice for passing enum params in Web API
I have a RESTful Web API project, and I have 2 different Enum scenarios that I'm unsure of re best practice. My API method requires a parameter called `ruleType`, with valid values being `EmailAddr...
- Modified
- 30 Sep at 10:51
ffmpeg overwrite output file if exists
I ran: ``` ffmpeg -i input.flac output.mp3 ``` This prompts: > File 'output.mp3' already exists. Overwrite? [y/N] y How do I automatically say "yes"?
- Modified
- 14 Jul at 20:30
C# WebClient NTLM authentication starting for each request
Consider a simple C# NET Framework 4.0 application, that: - - - Here's a sample that works fine: ``` using System; using System.Net; namespace ConsoleApplication1 { class Program { ...
- Modified
- 30 Sep at 08:51
asp.net core app deployed on iis meets 500 internal server error
> :( Oops. 500 Internal Server Error An error occurred while starting the application. This message came out when I added database functionality to my asp.net core app and deployed it to iis. Wh...
- Modified
- 30 Sep at 07:14
how to modify the size of a column
I created the table Test_Project2 in Oracle SQL Developer. After that I realized that the column proj_name is of a small size, so I decided to modify the column using the follwoing statement ``` ALTE...
- Modified
- 30 Sep at 12:25
Check date between two other dates spring data jpa
I have this model: ``` public class Event { private String name; private Date start; private Date end; } ``` and repository as ``` @Repository public interface EventRepository extends Jpa...
- Modified
- 19 Nov at 22:21
Possible to cast to interface that isn't inherited?
Why isn't it possible to cast an instance of: ``` sealed class Foo { public void Go() { } } ``` ...to this interface: ``` interface IBar { void Go(); } ``` ...even though `Foo` has the s...
- Modified
- 30 Sep at 03:2
Filter input text only accept number and dot vue.js
I have a text box and only want to accept numbers and a period "." when using VueJS. Can anyone help with code? I'm new to Vue.
- Modified
- 1 Apr at 21:13
EF core one-to-many relationships HasOne().WithMany() vs HasMany().WithOne()
Let's say I have the following 2 models: ``` public class Blog { public int BlogId { get; set; } public string Url { get; set; } public List<Post> Posts { get; set; } } public class Pos...
- Modified
- 6 Jan at 22:30
How to see if running under service fabric
I sometimes run projects locally out of visual studio is there a better way to detect if I'm hosted by SF rather than the exception. I can see possibly the path or entry assembly but there must be a b...
- Modified
- 29 Mar at 21:30
How do I build a dynamic Where clause with Dapper when passing in a model
I have an example model that looks like this: ``` public class PersonModel { public int Id {get; set;} public string FirstName {get; set;} public string Lastname {get; set;} publi...
How to get Windows Version - as in "Windows 10, version 1607"?
It seems that the word "version" in reference to Windows is used for different things. For example, the Windows 10 "Anniversary Update" is labeled "Version 1607" by Microsoft ([here](https://support.m...
Extract the video ID from youtube url in .net
I am struggling with a regex to extract the video ID from a youtube url. `"(?:.+?)?(?:\\/v\\/|watch\\/|\\?v=|\\&v=|youtu\\.be\\/|\\/v=|^youtu\\.be\\/)([a-zA-Z0-9_-]{11})+";` It's working since it ma...
'ng serve' does not work after a double install
I used to have Angular CLI, but I mistakenly installed it again with ``` npm install -g angular-cli ``` And now when I run `ng serve` it complains: > It seems like you're using a project generated us...
- Modified
- 14 Jan at 18:50
Misleading SQL Exception Text cannot be compared
I get that exception when OrmLite make the following call : ``` return db.Select<T>(x => x.Name == name && x.PuId == puId).FirstOrDefault(); ``` > Exception :"System.Data.SqlClient.SqlException (0x...
- Modified
- 23 Mar at 20:25
Entity Framework Core: many-to-many relationship with same entity
I am trying to map many-to-many relationship with the same entity. The `User` entity has an `IList<User>` data field for `Contacts`, which stores users' contacts/friends information: ``` public class...
- Modified
- 8 Mar at 17:58