Posts

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

Bootstrap3 - Radio Nested/Collapsible

Last year I create a login page which I'm very happy to say I built it just how I wanted it. A rare thing if you've ever had to deal with management. Since the page only existed within sharepoint I want to keep things simple. So I went with jquery 2.x and bootstrap 3.3.7.  Oldies But Goldies; so  a few things I didn't want to create a lot of jquery code. So I had to really use the bootstrap collapsible component as much as I could without breaking it. Examples Bootstrap PixKrh7Su5 Bootstrap Fdjc8kQiER Disable collapse for link in a data-toggle element You need to add a class for those elements that you don't want to fire the collapse event and then stop the event propagation via javascript. So... here is the correct answer. <div class = "panel panel-default" > <div class = "panel-heading" > <div class = "panel-title" data-toggle = "collapse" href = "#collapseOne" >

Gitlab: Switching to Access Tokens with Your Repos

If you haven't yet switch to using Access Tokens for your repo clone. Enable your  Two-Factor Authentication and create an access token under your profile. I've done this with my gitlab and keep forgetting the quick way to update the path/command. Go to https:/// YOURGITLAB.com/ profile/two_factor_auth Then go to  https:// / YOURGITLAB.com/ profile/personal_access_tokens  create a token with the api setting. Now switching your remote url for your git is simple. Using this command.. git remote set-url origin http://USER:TOKEN@YOURGITLAB.com/repo.git If you have multiple origin urls you might have to remove them and add back an origin upstream and reset the origin master as the default upstream. This doesn't normally happen but I had a unique case where I had multiple urls for the origin where I was pushing to multiple repos for the same code. This probably won't be your case but I figure I might add this bit in.

Angular 1.X Filter by Properties

Filtering By Nest Property $scope.list = [ { 'Name': 'A', 'Manager': { 'Name': 'X' } }, { 'Name': 'B', 'Manager': { 'Name': 'X' } }, { 'Name': 'C', 'Manager': { 'Name': 'Y' } }]; <ul> <li ng-repeat="e in list | filter: {Manager: {Name: filter.key}}"> {{e.Name}} (Manager: {{e.Manager.Name}}) </li> </ul> F ilter not equals <li class = "list-group-item" ng-repeat = "question in Questions | filter:{ Id: '!-1'}" > <div href = "#" editable-text = "question.Text" > {{question.Text}} </div> </li> How to get key of the object?   (not in the view) The first parameter to the iterator in  forEach  is the value and second is the key