If you find yourself stuck because you need to use EF 6 features in an ASP.NET Core web app with Identity, don’t worry, it is easy!

Like many of you, I am trying to get all caught up with ASP.NET Core. It has some great features and I’ve been looking forward to using it. I finally have a new project to start so Core was my first choice.To expand on that a bit, I am using ASP.NET Core with the full .NET Framework. At this point, I don’t need to use .NET Core in cross platform scenarios.

It wasn’t long after I got started that I ran into what I thought was a big problem.Spoiler Alert: It wasn’t a big problem at all!

A new project created for ASP.NET Core (configured to use Individual Accounts for security) will be all loaded up with Entity Framework Core as well as Controllers and Views and Code to make all the authentication stuff work. This post isn’t about that. It was all working nicely. That is, until I needed Entity Framework Spatial Types with SQL Server. My website needs to calculate distance between two points, something that is surprisingly easy with the right tools. However, EF Core doesn’t yet support that! I’d needed EF 6 instead. Now, this is where I made my big mistake. I assumed that I couldn’t have EF 6 and EF Core in the same project so I removed all of the EF Core stuff. I began to set up EF 6 instead and ran into issues wiring things up with ASP.NET Core. To set up all of the Dependency Injection stuff and wire up services, you need code like this:

services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();

But it turns out that AddEntityFrameworkStores doesn’t exist in EF 6. This got me going on all kinds of research, trial and error. All for nothing.

You see, I was going about this all wrong.

Thanks to some help from Julie Lerman (Entity Framework Guru and fellow Microsoft MVP) and Diego Vega (from the EF team at Microsoft), I found out that I could in fact run EF 6 and EF Core in the same project! All I needed to do (after getting all of the EF Core nuget packages all loaded up again) was create 2 DbContexts! One with EF Core for the Identity stuff. And one with EF6 for my application logic (so I can use the spatial features including DbGeography). At first, I had a some namespace confusion because there are classes with the same names in EF 6 and Core. But that was easily resolved.

It’s great when the solution is so simple.

This past Friday, I had the pleasure to present a full day of content at day 1 of Philly Code Camp. My talk has an odd title: “End to End Development With Schwammy’s Favorite Patterns and Practices” This was the fourth time I did this talk and it has sold out very quickly each time so far. So I guess the silly title makes sense to people. Or maybe it’s that they read the description:

To create excellent software, you need to know a lot more than just the language basics. If you are an experienced developer looking to take things to the next level, this talk is for you. In this talk I’ll present many patterns and practices that I use as a Technical Architect. I’ll review and demonstrate many of my favorite patterns such as SOLID, Repository Pattern, Unit Of Work, Dependency Injection, etc. I’ll show how these patterns can be used for both server and client side development in ASP.NET MVC. I’ll demonstrate great ways to use TFS for automating your builds and deployments. During this full day session I will create a web application using VS2015, C#, ASP.NET MVC, Entity Framework, SQL Server, Bootstrap, Knockout.js and ELMAH. Unlike in traditional short talks, with the full day session you’ll see how all the pieces fit together. As always, I’ll throw in lots of tips and tricks along the way. FYI: this is a repeat (with some updates) from my popular full day session from the last Philly Code Camp. The session will not be hands-on for attendees however I’ll provide the complete solution with which you can review and experiment.

It’s a jam packed day – about 7.5 hours of me talking. I’m truly honored that people sign up to spend the day with me. Thanks to all of the attendees who participate and ask questions and make it a great day. Of course, a big thanks to the Philly.Net team Bill Wolff, Rob Keiser, Ken Lovely and a bunch of other great people who run that event so well year after year. I know how hard it is since I used to be one of them Smile.

So here is all the content. I’ve posted it before but this is the most up to date version:

Good luck, it was never really meant to stand on its own so it may not make sense. If you have any questions, let me know.

image

We are having a blowout sale on TechBash tickets. Plus, the Kalahari has extended our room discount (while supplies last). You can now attend TechBash (tickets and hotel) for under $650! Here is the news you need…

TechBash is Sept 28-30 2016, Pocono Manor, PA

Here are 3 great reasons to register for TechBash 2016

1. The Content is really awesome!

The first and most important reason to attend a tech conference is learning. We’ve got you covered with some of the best and most knowledgeable speakers from across the country! At TechBash you will get the facts from experts. Learn about web, cloud, DevOps, design patterns, and tools. Want to learn about Microsoft tech like ASP.Net, Azure, C# or Visual Studio? At TechBash you will get expert knowledge and great perspective because we have speakers from inside and outside of Microsoft. Here are some names to get you interested:

From Microsoft: Amanda Lange, Chris Risner, Dave Voyles, David Giard, James Tramel, Jeffrey Fritz, Joel Cochran, Pete Brown, Stephen Bohlen

Microsoft MVPs: Chris Woodruff, Iris Classon, James Bender, Jesse Liberty, Jim Wooley, Joseph Guadagno, Ondrej Balas, Oren Novotny, Sam Basu, Steve Michelotti, Kevin Hazzard, and organizers Alvin Ashcraft, Andy Schwam, Brian Minisi, Devin Rader

But that’s not all: We’ve got other top speakers including Glenn Bock, Joe Kuemerle, Kendall Miller, Ashley Grant, Bradley Holt and more!

image

Click here to see our full schedule!

2. The Location is great (and close by to many of you)!

Our venue, the Kalahari Resort is really cool. It’s a new Resort, Conference Center, and 100,000 sq. ft. indoor waterpark! TechBash is located in the Pocono Mountains in PA. That means it’s not only a beautiful setting, but it’s also really close. If you are in the northeast US and tired of flying cross country for tech conferences, TechBash is for you. We are less than a 2-hour drive from New York City, Philadelphia, and northern NJ. And this location is still within reasonable driving distance of many other major cities in the northeast, including Boston, Pittsburgh, Baltimore and Washington, DC!

clip_image004[4]clip_image006[4]clip_image008[4]clip_image010[4]clip_image012[4]

3. The Price is Right!

This Labor Day we’re celebrating everyone who puts in a hard day’s work by offering you the best TechBash deal yet.

Our best price ever: Buy your ticket between August 31st and September 7th using the promo code TBLABORDAY and we’ll knock $100 off the normal registration price and you get our discounted Kalahari hotel room rate of $159 per night. This offer is for a limited by room availability at the Kalahari so don’t wait.

Now is the time to register!

Talk to your company, and let them know great advantages of attending TechBash. Tell your boss that about the content and the savings. Talk to your family, and think about combining the conference with a long weekend of water park fun! If you want any other information, contact me or check out our website www.techbash.com.

TechBash 2016 is a non-profit, community run event.

techbash-2016The content for TechBash is really looking good. Ok, I am biased a bit because I am helping to run the event Smile.

But seriously, we’ve got great speakers coming in from around the country to share their knowledge with you. I’m excited about a lot of it but some areas really stand out. For us ASP.NET developers, so much is changing and there is a lot to learn. Now is the time to get up to speed. Here are a just a few of the talks that are sure to help:

Title: A Deep Dive on ASP.NET Core

Presenter: Jeffrey Fritz

Are you considering ASP.NET Core for your next project? In this session, join one of the Microsoft program managers responsible for this new development platform as we take an in-depth look at the new ASP.NET Core platform. We will cover how the new .NET command-line interface enables you to build applications inside and outside of Visual Studio. We’ll look at how to use ASP.NET Core with docker and how you can build re-usable components with NuGet integration. Attendees of this session will have a deeper understanding of the topics they need to deliver more effective and faster applications with ASP.NET Core.

If you don’t know Jeff, you should. For us Philly locals, Jeff is well known as he is one of us. He’s been speaking in our area for years (I’m pretty sure was at his first talk ever) and now he is a Senior Program Manager at Microsoft! Not only that, he’s a great presenter and writer! Yes, this is a great opportunity to get the info from someone who really knows his stuff. We are really lucky to have Jeff with us at TechBash. You can see Jeff’s full bio and view all of the sessions (although the list is still growing) on the TechBash website.

Title: Getting started with Entity Framework Core

Presenter: Jim Wooley

With the cross-platform version of .Net, Microsoft has had to rewrite many of the core components that we have come to depend on. If you include data in your applications, chances are you have used Entity Framework in the past. In this session, you’ll learn how to get started using EF Core and how to handle the changes in this version.

Lucky for us, Jim Wooley is traveling to us from Atlanta. He’s the author of the popular “LINQ in Action” which is an awesome book. He’s also a great, popular presenter at conferences around the country. You can see Jim’s full bio and view all of the sessions (although the list is still growing) on the TechBash website.

Title: A Lap around ASP.NET Core 1.0!

Presenter: Sam Basu

Man, naming products is hard! But change is in the air for ASP.NET developers, as vNext ushers in a new era. Let’s talk – .NET Core | ASP.NET Core 1.0 | Open Source | .NET Frameworks Changes| ASP.NET Runtimes | WebForms | MVC 6 | Cross-Platform Tooling | Omnisharp.NET | Homebrew | Yeoman | CLI with VS Code or Sublime Text | Docker. Join me as we explore all that’s new & shiny. This is one of the best times to be an ASP.NET developer – let me show you why!

 

Did you read the summary above? Can you see how much there is for us to learn to be ready for ASP.NET Core? Sam Basu is coming in to help us out. Sam Basu is a Developer Advocate at Telerik (now Progress). He’s also a popular speaker and you are sure to learn a lot. You can see Sam’s full bio and view all of the sessions (although the list is still growing) on the TechBash website.

So, is that all?

NOPE! There will be lots of other great sessions at TechBash 2016. Please check out the current list on our website. I’ll try to highlight more soon.

TechBash: Sept. 28-30, 2016

Kalahari Resort, Mt Pocono, PA

Purchase your tickets and book your room now! We have a limited number of tickets and hotel rooms.

I look forward to seeing you there!

techbash

TechBash 2016 is a brand new developer conference taking place on September 28-30, 2016. I’m one of the organizers along with a small group of friends from the developer community. TechBash will feature great presentations for you by a variety of awesome speakers from around the country. Our venue, the Kalahari Resort is really cool. It is a brand new Resort, Conference Center, and 100,000 sq. ft. indoor water park! TechBash is located in the Pocono Mountains in PA. That means it’s not only a beautiful setting but it’s close to many people living in the northeastern US. It’s less than a 2 hour drive from New York City, Philadelphia, and northern NJ. And this location is still within reasonable driving distance of many other cities in the northeast!

Our goal is to inspire our attendees to build great things. At TechBash, we are building an environment that is designed for attendees to get the most out of the event. In the many sessions at TechBash you will learn all sorts of new things. But we know that a lot of great things happen outside of the talks as well. That is why we will have a great attendee lounge that will have plenty of space for you to hang out and talk with old friends and new. It will provide a great place for speakers and attendees to have follow up talks after sessions. There will be snacks and coffee. And it will also include our Hack Lab and our vendors as well. The Hack Lab is a space for our attendees, speakers and sponsors to collaborate, brain storm, hack and even demo the results!

TechBash is a community driven, non profit event (although not a charity) organized by the TechBash Foundation.

If you are already hooked, just register (registration info is below)! And please read on if you need a bit more convincing…

Content is Key!

Our goal is to be technology/platform agnostic. We know that nowadays, developers are interested in all kinds of stuff and there is a lot to learn for us all. Having said that, the agenda is weighted towards Microsoft Technology.So while we have content on ASP.Net (including Core), Azure, Xamarin, Visual Studio, C# and more, we also have talks about JavaScript, Docker, Go, Design Patterns, Web Security, OSS, Agile, and more. For all of the latest details, check out the session list. Keep in mind, as with any event, the schedule is subject to change.

Location, Location, Location

imageAs I said above, TechBash is pretty close for many people in the northeastern US. Sure, those of you from NYC to Philly are all set with a simple 2 hour drive. But if you are from DC to Boston to Pittsburg and beyond, this location is a reasonable drive for a 3 day event! Here are some drive times (according to Google Maps – your times may vary Smile). No air travel required!

City Drive Time City Drive Time City Drive Time
NYC 1:48 Philadelphia 1:53 Harrisburg, PA 1:59
Toms River, NJ 2:19 Syracuse, NY 2:28 Albany, NY 2:58
New Haven, Ct 2:49 Baltimore, MD 3:14 Wash. DC 4:01
Providence, RI 4:24 Buffalo, NY 4:43 Boston, MA 4:48
Pittsburgh, PA 4:51

 

Destination: Fun

Ok, so you are headed out for a 3 day tech conference. That doesn’t mean you can’t have some fun too! We’ll fry your brain all day long with tons of great content that you can take back to the office and put to good use. But in the evenings, why not enjoy the 100,000 square foot indoor water park? TechBash is hosted at the brand new Kalahari Resort and Convention Center. Yeah, it’s a state of the art conference center and great hotel. But they have restaurants, a Spa, an arcade, indoor mini-golf, hiking and more. Oh, did I mention the 100,000 square foot indoor water park?

waterparkwaterpark2waterpark3

 

Is this a family event?

Yes and no. We know that other similar conferences have kids’ tracks and family content. Plus, there is the water park. While the venue is certainly family friendly, TechBash won’t have any family content in year one but it is part of our long term plan. Let’s get through one year with content for the “big kids” only. But if you want to bring your family, please do so! We are sure they will have fun!

Sponsorship Opportunities Available

We’d love to work with your company as a partner to help make TechBash 2016 even better. Check out our website and our prospectus for more info and then contact me to get things started.

Want to help out while you are at TechBash?

Yeah, we’ll need some help running this event. If you want to help out, sign up, there is a simple form on the bottom of the website.

The most important part: Registration

Registration is easy, there are two simple steps:

  1. Click here to purchase a conference ticket on EventBrite.
  2. Book a room at the Kalahari. Just call 1-855-356-9208 and mention TechBash to get the best rate.

Thanks for reading. I’ll post more information about TechBash soon.