Integrations tests with ASPNetCore and ServiceStack
I have an ASP.Net Core 1.1 project that is using ServiceStack Core. I am trying to write a basic integration test that looks like so: ``` [TestFixture] public class BasicStartupTest { TestServer ...
- Modified
- 4 Aug at 15:13
How to create a MVC MvcHtmlString in ASP.NET Core
I wonder if someone can help with demonstrating how to create a IHtmlContent or HtmlString in ASP.NET Core, similar to what I previously have done in MVC5. I would normally declare a new MvcHtmlString...
- Modified
- 7 May at 05:51
How to use ConfigurationManager? (Microsoft.IdentityModel.Protocols)
I was recently forced to update my System.IdentityModel.Tokens.Jwt NuGet package to 5.1.4 because of another NuGet package. Most of the code after changes seem easy enough to solve, but now `Configur...
- Modified
- 4 Aug at 07:32
Is there any way to get request body in .NET Core FilterAttribute?
Sample of my request ``` http://localhost:8065/api/note POST content-type:application/json request body: { "id" : "1234", "title" : "test", "status" : "draft"} ``` and the response should be ``` {...
- Modified
- 4 Aug at 09:44
Why does calling a generic local function with a dynamic parameter produce a BadImageFormatException?
Playing around with C# 7's Local Functions, I ended up with some interesting behavior. Consider the following program: ``` public void Main() { Console.WriteLine("Entered Main"); DoSomething(...
ASP.NET Core MVC Mixed Route/FromBody Model Binding & Validation
I am using ASP.NET Core 1.1 MVC to build an JSON API. Given the following model and action method: ``` public class TestModel { public int Id { get; set; } [Range(100, 999)] public int ...
- Modified
- 4 Aug at 14:45
AutoQuery / Ormlite-servicestack: Can I filter out soft deletes on a QueryDb class?
We have a few services built up with Ormlite/Servicestack and we are mostly pulling out database objects and POCOs using `QueryData` with custom logic. However, we have one table that really doesn't ...
- Modified
- 3 Aug at 21:44
How can I validate Request.Headers["Authorization"] for all controller at a single place?
``` [HttpGet] public IActionResult Get() { string token = Request.Headers["Authorization"]; // Validate token. } [HttpPost] public IActionResult Post(int id) { string token = Request.Head...
- Modified
- 3 Aug at 21:50
How can I use, in Visual Studio 2017, the "C# Interactive" window to query a source in my "Data Connections"
I'm connected to an external SQL server in my "Data Connections" (in the "Server Explorer" view). I can right click my SQL source and click "New Query" to quickly look up data with SQL statements. I ...
- Modified
- 13 Aug at 20:51
React Navigation back() and goBack() not working
I'm trying to go back two screens. The goal is to go from `EditPage` to `Cover`. Here is my navigation stack: `Main -> Cover -> EditCover -> EditPage` I read the docs and it says to supply a key ...
- Modified
- 4 Aug at 08:49
ServiceStack Register web service slow performance
We noticed some performance bottlenecks in Service Stack web services especially the ones that comes out of the box like (Register) Web Service. We ran a load-test using Visual Studio Load Test with...
- Modified
- 3 Aug at 13:13
How do I install NUnit 3 console on Windows and run tests?
I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version): ``` $ nunit3-console test.dll ``` I googled a lot, but can't find how to set...
- Modified
- 14 Mar at 23:23
servicestack read from web.config fails in production build
I need to read values from web.config ``` IAppSettings appSettings = new AppSettings(); var slackWebHookUrl = appSettings.Get<string>("slackWebHookUrl"); ``` in dev conditions it works. Bu...
- Modified
- 3 Aug at 09:49
ServiceStack.Redis.RedisResponseException: unknown command 'SCAN'
I registered my RedisClient in my ServiceStack app host as follows ``` container.Register<IRedisClientsManager>(c => new RedisManagerPool(conn)); container.Register(c => c.Resolve<IRedisClientsManage...
- Modified
- 3 Aug at 09:45
How to auto log every request in .NET Core WebAPI?
I'd like to have every request logged automatically. In previous .Net Framwork WebAPI project, I used to register a delegateHandler to do so. WebApiConfig.cs ``` public static void Register(HttpConf...
- Modified
- 3 Aug at 09:7
How to set TTL to List Values in ServiceStack.Redis?
I Have a List in ServiceStack.Redis that I want to set a TimeSpan to expire it. In the other word, how to call the following redis command in ServiceStack.Redis > EXPIRE ListId ttl my desired meth...
- Modified
- 3 Aug at 07:5
What is the difference between Aes and AesManaged
I found two class in C# related to , and example code of them MSDN provides are similar, what is the difference between these two classes? [https://msdn.microsoft.com/en-us/library/system.security....
- Modified
- 31 Oct at 17:18
Laravel Migrate Specific File(s) from Migrations
Hi read all the included documentation here in [https://laravel.com/docs/5.4/migrations](https://laravel.com/docs/5.4/migrations). Is there a way on how to migrate a certain migration file (1 migrati...
is there a null conditional operator in Vbnet?
cIn C# there is a null conditional operator `?.` (sometimes called the Elvis operator) like so: ``` var name = project?.customer?.name; ``` which doesn't fail but instead return `null` if `project`...
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'
I know there are a lot of same questions already posted in stack-overflow and tried different solutions to avoid the run-time error but None of them are working for me. [](https://i.stack.imgur.com/4...
- Modified
- 23 Apr at 20:25
Angular 2 /4 adal-angular4 active directory authenticate to API issue
I've been following this example to access azure active directory from an angular (4) application: [https://github.com/benbaran/adal-angular4-example](https://github.com/benbaran/adal-angular4-example...
- Modified
- 2 Aug at 23:32
Count the Number of Tables in a SQL Server Database
I have a SQL Server 2012 database called `MyDatabase`. How can I find how many tables are in the database? I'm assuming the format of the query would be something like the following, but I don't know...
- Modified
- 9 Apr at 21:41
Include Nuget dependencies in my build output?
I am building a modular .NET core application that can load extensions at runtime using MEF. I have 2 projects, one is a library that I want to be able to load at runtime, then I have my main applicat...
- Modified
- 2 Aug at 15:0
Marshal a va_list
I have the following code: ``` [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void PanicFuncDelegate(string str, IntPtr args); private void PanicFunc(string str, IntPtr args) { ...
Using ffmpeg to change framerate
I am trying to convert a video clip (MP4, yuv420p) from 30 fps to 24 fps. The number of frames is correct so my output should change from 20 minutes at 30fps to 25 minutes at 24fps. Everything else sh...
- Modified
- 2 Aug at 16:2