Generating Entity Framework classes for Database First project

Not all projects, or development teams, use Code First with Entity Framework for building and maintaining their database.  There are plenty of reasons for doing it either way but that discussion is outside of the scope of this post.  What this post is going to focus on is generating your EF classes in a Database First environment.

Microsoft has plenty of great documentation for developers and one such post that I used recently was Getting Started with EF Core on ASP.NET Core with an Existing Database.  My setup is Visual Studio 2017 Community Edition and a .NET Core 2.1 project structure.  The database is running on a free, local instance of SQL Server 2017 and consists of a handful of tables.  To generate the classes I utilized the Package Manager Console (PMC) in Visual Studio and the Scaffold-DbContext command.

Scaffold-DbContext "Data Source=localhost\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=True;" Microsoft.EntityFrameworkCore.SqlServer -outputDir Repository -Verbose

The connection string is pretty basic.  I’m telling it to connect to a database on my machine called MyDatabase and use my Windows Credentials for authentication.  The files generated should go into the directory called Repository in my project.  And for help with debugging any problems I include the -Verbose parameter.

Upon completion all generated files were open in my VS instance for inspection and located in the folder I set as the output destination.  If this didn’t happend and you have an error message make sure that your project builds on its own.  If the project doesn’t build then the Scaffold-DbContext won’t be able to generate the files.  One thing to check before you submit your code to any repository is that in your Context.cs class the connection string used for Scaffold-DbContext is hard-coded into the file.  If the code is going to a public repository you’ll want to make sure this line is removed.

Using AdMobFree plugin with Ionic 3

Recently I updated one of my applications to use the Cordova Plugin AdMobFree to show advertisements in my Ionic app to generate revenue. There are several plugins available to Ionic developers to use for showing ads from AdMob but this one provided the core features I needed without a bunch of bells and whistles I didn’t. This post will go over the steps I took in order to get the plugin to work in my project. If you run into any issues let me know and I’ll see if I missed a step.

To start, let me be clear that this is geared to projects developed utilizing the Ionic 3 framework. It should work for Ionic 2 applications as well but I would not base an Ionic 4 application off of this code given all the changes that have been made for that framework.


$ ionic cordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID="<YOUR_ADMOB_APP_ID_AS_FOUND_IN_ADMOB>"
$npm install --save @ionic-native/admob-free@4

Make sure you include your APP ID from AdMob. You can get the value by going to AdMob then clicking on the application under Apps and going to App Settings.

In your config.xml file you should see a section for cordova-plugin-admob-free that has the ADMOB_APP_ID variable defined with the value you passed in during the installation. If not then run the remove command for the plugin and try adding it again.  

One thing worth remembering is that if you run into build issues where errors are reported about the Android version or support libraries used then you’ll want to install the Cordova Android Support Gradle Release npm package.  

When it comes to installing your Android platform I recommend installing version 6.3.0. 

$ ionic cordova platform add android@6.3.0

With that you should have all of the packages and configuration completed.  It is now time to dive into the code.


The first changes to your code have to be made in the app.modules.ts file.  You’ll need to import the plugin and add it to the providers section.

import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';

declarations: [...],
imports: [...],
bootstrap: [...],
entryComponents: [...],
providers: [...

On the page you want to show the ads you’ll only need to make changes to the underlying TypeScript file.  You’ll first want to import the necessary packages.

import { AdMobFree, AdMobFreeBannerConfig } from '@ionic-native/admob-free';
In the constructor include the AdMobFree declaration.  
    private admob:  AdMobFree) {}
private createBanner() {
let logger:LoggingProvider=this.logProvider;

try {
let bannerConfig:any= {
id: <android banner id>,
autoShow: true,
isTesting: true

.then(() => {
//We have a banner :)
}).catch((error) => {
// Handle the error case
catch (exception) {
// Something bad happened

And that is it.  You should have a basic banner displaying on the application.  Once you are ready to go to production you’ll want to change the isTesting parameter to false so real advertisements come through.

If you want to give the option for your users to go advertisement free there is an easy method call to remove the banner.


When I get some time I’ll try to put up an example project or put in a pull request for a demo on the AdMobFree repo.  Until then, let me know if I missed anything and I’ll update the instructions.

Divide by Zero

You know what might ease tensions? If everyone took a break from political shows, web sites, radio, and news for a while. Take the soap opera drama that passes as news and just detox for a good few days, weeks, months, or years. Maybe the superficial hate will dissappear. Maybe the imaginary lines that have been drawn will fade away. Because if not this constant division will get to the point where you can’t divide society any further. That is when you divide by zero and everything falls apart.

A Break from Facebook

This past June I took some time off from Facebook.  The site was consuming too much time and always made me feel a bit empty after using it.  So, from June through most of August I was Facebook free.  I’d say it was nice but it wasn’t…the time off was GREAT!

I have no idea how much time I was able to get back but it had to be several hours a week.  And I honestly felt happier than before.  Now I will admit that I have Instagram and when I suspended my Facebook account I started spending a bit more time there, which is also owned by Facebook, but the draw to be on the app was far less.  Instead of checking multiple times a day I’d check once or twice every few days.  And when I was on Instagram the amount of time didn’t even compare to Facebook since I was only browsing photos of friends or organizations I followed and the numbers I follow are far less than the “Friends” I have on Facebook.

But, like so many other good things, the break came to an end.  The choice to reactivate the account was actually uncomfortable because I was afraid I’d go back to wasting time on the site.  The reason for re-activating was simple, my coworkers all message, trade and sell things, and setup work events through Facebook so if I wanted to be apart of the group I’d have to rejoin the social network.  I’m hoping that this will only be a temporary affair or that I’ll use the site sparingly now that I know how nice it is without it.  I hope…but if the hope doesn’t pan out then I may just need to suspend the account again.

Give it a try.  Try suspending your account for a few days, weeks, or months.  See what life is like without it.  You can still use the Messenger app with your account suspended.  And if you have any apps or sites that you login with your Facebook account you can do a “Forgot my password” option and just provide the email address you use for Facebook to get a temporary password.  Go ahead, see what life is like outside the blue of Facebook.

ion-toggle Toggle/Change event handling

I’m working on an Ionic v2+ app that requires some extra logic to be executed when a toggle switch, also known as a radio button, is changed.  In Ionic this component is called an ion-toggle.  I tried using the normal decorators like (change) or (click) but none of them were firing.  What I didn’t realize, mainly because I didn’t see it in the Ionic documents was that in order to handle changes in the state I needed to use the (ionChange) decorator on the component.  With this I could pass in more details to the function being executed.

<ion-toggle id="toggle{{}}{{}}"
     (ionChange)="onChildSelection(,, child.selected)">
 In the above example the id of the component is being set to include the name of the parent and child.  The state is based on the child.selected state which in this case is a boolean value.

Philadelphia Region Tech Employers

One of the hard things when looking for a job is getting a good listing of companies that hire in your field. Over the years I’ve kept track of companies that have posted jobs related to software development or developer operations in the Philadelphia, Pennsylvania region. There are a few that are more north in the Lehigh Valley region but I didn’t take them out as they are all within commuting distance. Hopefully this helps out fellow technologists find the next step in their careers in southeast Pennsylvania.

Last updated 07 January 2020

– 3Gtms
– Accolade, Inc
– Acurian
– Alion Science and Technology
– Allied Wire & Cable
– Almac
– Alphapoint
– Amdocs
– AmerisourceBergen
– Arrowroot Capital
– AWeber
– Azavea
– Bainbridge Health
– Benefits Data Trust
– Bentley Systems
– Betterment
– Blackfynn
– Blackrock
– Blue Cadet
– Boeing
– Bolt On Technology
– Brio Solutions
– Brooks Instruments
– Cadent
– CardConnect
– CDM Smith
– Cerner
– Chariot Solutions
– CHI Systems
– Cloudreach
– Cobham plc
– Comcast
– Converge Consulting
– CreativeMMS
– Creedence Solutions Inc
– Curalate
– Dell
– Dick’s Sporting Goods
– Dorman Products
– Drama Fever
– Drexel University Libraries
– Elsevier
– Elsevier
– eMoney Advisor
– EmployVision
– empowr
– EPAM Systems
– Equisoft
– Evantage Technologies Inc
– Evolve IP
– Express Scripts
– Freedom Pay
– Frontage Laboratories

– Gateway Ticketing Systems
– GlaxoSmithKline
– goPuff
– Greystones Group
– Grubhub
– Guru
– HealthJump
– Healthverity
– HomeNet Auto
– Honeywell
– ICON plc
– Inspire
– Integrity Applications Incorporated
– Interactive Mechanics
– Invata Intralogistics
– JOOR Engineering
– Kenexa (IBM)
– Kepler Group
– KL Discovery
– Kulicke & Soffa
– LifeShield
– Linode
– Lockheed Martin
– Lutron
– McKesson
– McNeil Consumer Healthcare
– MeetMe
– Merck
– Microsoft
– Mikros Systems
– Miles Technologies
– Molecular Devices
– Monetate
– Moven
– Music Choice
– Nartal Systems
– National Board of Medical Examiners
– NCC Automated Systems
– Neat
– Northrop Grumman
– NuCitrus Technologies
– Oracle
– ORS Partners
– Pariveda
– Penn Mutual
– PerPay
– Philadelphia Housing Authority
– Philadelphia Media Network
– Pinnacle 21
– PMA Companies
– Practice
– PracticeFusion
– Proconex
– Promptworks
– Pure Storage
– Push10
– QuantaVerse
– Red Tettemer
– RELX Group
– RevZilla
– Ring (Amazon)
– RJMetrics
– ROAR for good
– RS Energy Group
– s2s Communications
– Sabre Systems
– Sapient https://sapient.indistries
– Sapling Inc
– Sapvix
Scientific Search
– SEI Investment Company
– ShareTracker
– Sidecar
– Siemens
– Skyhook
– smithwise
– Stratus EMS
– Subaru of America
– Susquehanna International Group
– Syapse
– Syncro Medical
– Tabula Rasa HealthCare
– TechField
– Temenos
– The Meet Group
– Therapy Notes
– Think Company
– Tonic Design Co.
– trizic
– Turn5
– Tyndale USA
– Unisys
– Universal Health Services
– UPenn School of Medicine
– Vandegrift
– Vanguard
– Vertex
– VertMarkets
– Vistar Media
– Vitaver & Associates
– West Pharmaceutical Services
– Weather Trends International
– Weblinc
– We Buy Any Car
– Wildbit
– WipFli
– Wirecard
– YPrime

If you have any questions or suggestions leave a comment below.

Dealing with multiple HDD and SSDs

Over the years I’ve collected a lot of spinning hard disk drives as well as solid state drives.  The problem has been easily swapping between them when all I had were enclosures.  This year I finally decided to start consolidating the drives and reformatting some of them to be used for backup and went searching for an easy solution to swap the drives.  What I found was the StarTech USB 2.0 to SATA IDE Adapter.  With this adapter I was able to quickly connect and switch between my laptop and desktop sized HDDs and SDDs.  My laptop is a Windows 10 machine and required no extra drivers to be installed.  All that I needed to do was plug in the power adapter and the data cable to the drive, then connect the data cable to the computer and plugin the power adapter.  After that the drives appeared on my computer and I could easily explore the files on them.

So if you are looking for cables to quickly connect SATA IDE drives to your computer via USB then the StarTech USB 2.0 to SATA IDE Adapter is the way to go.  They even have USB 3.0 connectors too for your newer machines.

Convenient dumb light

In our garage the only way to turn on the light is to walk over to it and pull the cord.  Unfortunately this light is located between two hanging bikes, which my head hits often, and over our car.  After a few practice runs in the pitch black I’ve become somewhat proficient at pulling the cord without much fuss.  Still, it is a pain on several levels so a few months ago I started looking for an easy fix.  I didn’t feel like rewiring the light to a new switch by the door; too much work to figure out the right way to do it and patch all the holes I’d make.  And I didn’t want to install a smart light that could be controlled by an app as that seemed like overkill.  What I ended up settling on was a First Alert PIR725 Motion Sensing Light.

The sensor is a basic motion sensor that looks in a 360 degree radius for movement.  It seems to easily sense movement 15 feet away and is even able to peer through the bikes hanging on either side to detect when someone first steps into the garage.  Once the sensor turns on the light it will keep the light on for about two minutes after the last movement was detected.  This is great as it keeps the light from turning on and off while you are going in and out of a room as well as not letting the light stay on for a long time after you’ve finished up.  We’ve been using this light for about three months and haven’t had any problems with it.  So if you are someone who has a light in a hard to reach location I highly recommend taking a look at First Alert PIR725 Motion Sensing Light.  It just may make your life a little bit easier.

Diving into Cryptography

Cryptography is an art that has a rich history spanning over 2,000 years.  It has evolved from simple letter swapping algorithms called transposition ciphers, to using a key to shift multiple letters in the text with the Vigenère cipher, to modern day symmetric-key cryptography that uses advanced mathematics.  With this evolution the art has transformed itself into a science powered by mathematics.

The problem with cryptography is that it is extremely intimidating if you don’t already have a strong mathematical background.  While I enjoy math I am far from a strong candidate in the subject.  When I began to get really interested in the subject I started looking for a good book to break down the concepts into something easily understood and entertaining.  While there are plenty of books that deal with the raw subject the one I’ve found that walks the reader through the history and explains both how the algorithms work and how to crack them is The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography.  It even has a section at the end of the book that challenges the reader to break the codes for several different types of algorithms.

It is hard to imagine that a book which dives into the mathematical properties of cryptography could be a fun read but somehow the authors nailed it.  The first chapters start off explaining the basic forms of encryption and then build up to the advanced quantom cryptography that is being researched by some of the topped mathematicians.  The challenges at the end of the book have their answers available online.  When the book was published there was a challenge to see who could crack the codes first.  After just over a year the prize was claimed.  You can read about the challenge on the authors page, Simon Singh: Cipher Challenge.

If you have any interest in the subject I highly recommend picking up the book.  After you complete the book you’ll have a great grasp on the subject and maybe an itch to dive even deeper.

Tag all of your music with MusicBrainz Picard

For the last decade I’ve been half-heartedly trying to clean up and organize my collection of music.  This collection has duplicate, triplicate, quadricate? copies of songs.  Some songs are tagged with no name or artist while others have the completely wrong information associated with them.  In addition to this hole of chaos I could never figure out a good way to get updates made on my phone over to my computer without a huge hassle.  All that changed after I decided to pick up a new Micro SDHC for my phone that can more than handle my entire collection.

My saving grace turned out to be MusicBrainz Picard.  Not only is it free but it took my piece of chaos and fixed it.  The software has a great way to fix all of the ID3 tags in my MP3 and M4A files.  The application will tag songs based on the names of the files as well as lookup the fingerprint of the song.  Since the software is lets developers create their own plugins you can extend the application to incorporate information from or try your own hand at writing a customing plugin.

After playing around with Picard over the weekend I was able to cleanup over 90% of the music on my machine.  In looking at the music that wasn’t fixed I’m seeing a trend of duplicate songs and some that appear to have been corrupted.  Most likely I’ll be deleting the untagged files once I’ve verified they aren’t worth saving.  As always, if you find this software useful consider donating some money towards its development at MetaBrainz.