That John Bell

That John Bell John bell has been a professional web design, developer, and marketer since 2008 and software developer since 2017. Currently serving as an entrepreneur, he currently owns and operates several business serving marketing and analytics services.

22 March 2018 ~ 0 Comments

ASP.NET Core 2 Not Seeding? Try this!

I had recently created a fairly decently sized application, consisting of about a dozen models, a handful of controllers and a heaping serving of views.  Now, the standard school of thought for seeding data into the database is to create a class in your models and call it in your program startup.  You then have your seeding object check each table for data and insert data as needed.

This has worked for me for the most part, until this project.

I wish I had taken screenshots of the errors, but unfortunately I did not. I was having a lot of problems with concurrency, a second operating started on this project, or that the object has been disposed.

I toyed with it for hours trying to get everything to work properly, sometimes one of the sets of data would seed and other times others would seed, and it even seemed to vary depending on the speed of the system I was using.  I tried breaking everything out into individual methods, awaitng tasks in async methods, and countless re-ordering to try and get the most complete version of the data I could, I even ended up presenting the project with slightly incomplete data as the non-fatal error occurred again during the presentation.  Thankfully nobody knew ahead what I had intended the end result to be, so it went completely unnoticed.  But I knew.

I believe the culprit to be The Async methods required by Identity to create user accounts, roles, and assign roles.  I found the positioning of these seemed to have the most impact on which sets of data would generate errors.

The solution came to me randomly, but is quite simple and could potentially be a better way to seed data than the way I was taught in college and discussed earlier.

It’s a very simple solution, just place your seed data and checks in the constructors for your repositories.   After I split up the data into the repositories the database was seeding flawlessly.  It solved concurrency issues since it was only inserting when the repo object was instantiated rather than all the data nearly simultaneously.

In practice it functions exactly the same way that seeding the data would through a specific seeding class, in that you would have it check the table for entries and then generate them.  Of course, if you don’t need initial data for any of the tables then you won’t have to worry about seeding those tables.

Lastly, as a simple reminder, your seed data will is semi-permanent in an application so it may be worthwhile to make it something meaningful as opposed to just hollow test strings.

Let me know in the comments if this information is useful to you, or if you have anything to add or any other methods for seeding data that myself and other readers may not be familiar with.  Thanks!


16 November 2016 ~ 2 Comments

Traffic Exchange Owners are Losing Their Minds because of PayPal


PayPal has spent most of 2016 policing and limiting businesses, and traffic exchange owners are losing their minds.

There seems to be mass confusion going on as to what and why people are being limited, the reasons people are receiving are all varying, and this has caused all kinds of speculation, from things as silly as words used or upgrades offered and whatever else.

Traffic Exchange owners are doing some crazy things, many of them even going so far as blaming their customers.  They always talk about the “good old days.”  A time where magical unicorns walked the earth and pooped cupcakes and jellybeans.  A time that never really existed, then they try to shift blame as to what changed.

Some are wanting to completely flip their businesses on their heads and try to turn them into something completely different or unrelated to Traffic Exchanges.  It’s insanity the things I’m seeing in the skype groups.

Traffic Exchange users are becoming equally panicked, and for good reason, the “leaders” in this industry are saying some ridiculous things, in front of their customers too.

The truth is that many Traffic Exchanges will not survive, some will try to change their business model to comply with PayPal, only to find out that PayPal’s actions have little to do with traffic exchanges, as they are also limiting accounts of people selling information products, email marketing, coaching services, many digitally delivered products.

Others will try to convert to other payment processors and will not have the capital to sustain the financial impact of that transition.

Certain people are saying they should now take a more active role in the types of ads they accept.  I’ve been doing this since day one, and in those times I would ask people why they would allow obviously illegal scams to be advertised on their sites, and why they would allow their customers to fall victim to these scams, only to be told repeatedly that they can’t police the internet or that it’s not their job.  Now these same people standing on soap boxes telling everyone that they shouldn’t allow them.  I never did, they never should have, but either way that’s not going to increase favorability with PayPal.

Some will try to remain a traffic exchange in their current form, but try and push away their own audience.  I keep seeing things about “penny chasers” and “freebie seekers” and other vilification of their customers and question if they understand their target market at all, or how advertising actually works (If there’s nobody to see an ad, does it make a sound?).

It’s insane to me that businesses that have spent years targeting specific audiences would then say that those people aren’t good enough to be their customers.

There’s a lot of romanticizing over what a Traffic Exchange is, or what it should be, or what it could be.  And very little discussion over what it actually is.

The most important thing for the survival of a business is to understand exactly what it is, and what it is being used for.. not what you want it to be, not what you want people to use it for, but what the reality of the business is.  Knowing Exactly who your customers are, and why your business has succeeded (or hasn’t).

There’s a lot of reactionary nonsense going on, and it’s going to wreck havoc on the Traffic Exchange market.

But then there are others.  There are people who understand who their businesses serve, understand who their customers are and what it is they are seeking.

Traffic Exchanges have always been incentive based, they’ve always been for small home businesses and beginning entrepreneurs to be able to advertise and build their lists without capital.  Regardless of if you are surfing for some credits to advertise, or a few cents to go towards your hosting bill, it’s the way traffic exchanges have always worked since day one..  Those who understand the nature of their business will continue to succeed, and those who don’t will try to change everything.  It won’t be PayPal or any other payment processor that kills their business, it will be them.

Traffic Exchanges aren’t dead… but unfortunately many will die.

Related Posts Plugin for WordPress, Blogger...