Posts

NLog Killing Aspnet Core Application

Image
Awhile back I moved to a new location for storing my server and for the most part things went smoothly. Didn't have any issues with my local DNS or emails, however I did encountered one issue. The issue was Recycled Motors where the application would boot but instantly fail. Which didn't create any logs or errors for me to look. So it took me a few weeks along with everything else going on to figure this one out. I spend a little too much time looking into my network and the bind9 configs because I know it had to do with my configs. Originally I was on a 10.0.10.x network but with the I.P. the modem only allowed the regular 192.168.1.x ip address. Eventually I figured out the issue, being my NLog config itself. I have it writing in a database where I list the ip address explictly. I completely forget about this since it was just a quick thing I added a few weeks before the move and I still have it pointed to localhost in the appsettings.json Solutions Use different envir

.NET Core Docker Image for SPA Applications

If your looking to get CI/CD up and running with a SPA Application I recommend this setup. This article is based on Aspnet Core 2.1 and up. If you read the docker docs on the 2.1 version of dotnet core you will see they removed nodejs, which breaks a bunch of stuff if your using dotnet core with either Angular2 or Reactjs. I currently use gitlab-runners but with the volumes config to publish my sites. Notes from Dotnet Using NodeJS in  microsoft/aspnetcore-build , but this is missing from  dotnet/core/sdk:2.1 . What should I do? You can either install NodeJS by adding a few lines of code to your Dockerfile that download and extract NodeJS, or you can use the multi-stage feature of Docker and the official NodeJS images. Sample code to install NodeJS on your own: # set up node ENV NODE_VERSION 8.9.4 ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x

Randomly Return Rows in EFCore with Postgresql

Currently working on a random list motorcycles to display on my front. At the moment don't have any priority listening on my site for clients other than the list of bikes I'm trying to sell personally as a source of income. For now this is what I did and its just these two parts to get things going. something . OrderBy ( r => Guid . NewGuid ()). Take ( 3 ) If you don't already have the extension this command will check and install for you. CREATE EXTENSION IF NOT EXISTS "uuid-ossp" ;

Entity Framework: ToListAynsc & WhereAsync

When upgrading aspnet mvc applications I like to take a look on how I can convert the api's to async. This sometimes is really easy but as things get more complex my queries do as well. So this is a list of ways you can form a where clause on top your  async  but note not all solutions take advantage of it. Notes on EFCore Entity Framework Core provides a set of asynchronous extension methods that can be used as an alternative to the LINQ methods that cause a query to be executed and results returned. Examples include  ToListAsync() ,  ToArrayAsync() ,  SingleAsync() , etc. There are not async versions of LINQ operators such as  Where(...) ,  OrderBy(...) , etc. because these methods only build up the LINQ expression tree and do not cause the query to be executed in the database. https://codereview.stackexchange.com/questions/32160/filtering-a-collection-by-an-async-result Filtering a collection by an async result ,  built an extension method called WhereAsync. publ

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql