Visual Studio ASP.NET MVC controller with views and EF template creates db.ApplicationUsers instead of just db.Users.
1. Rename ApplicationUsers to Users
2. Delete the Controller and View
3. Close and Re-open VS and Project. Rebuild.
4. Recreate the Controller!
So its in the morning, you said lets scaffold! And you got this error:
This happens when you reference a foreign key your “ApplicationUsers” that is used in the IdentityDbContext that inherits IdentityUser.
And then when you add a new controller with views using EF the scaffold will generate the ApplicationUsers but its DbSet or property of the object will not be available.
One workaround is to rename your ApplicationUsers to only “Users”.
Now this is important, delete the controller and its views folder after renaming. Then you need to close visual studio.
Open the project once more and rebuild your solution.
You should now be able to scaffold the controller.
So its late, I am in a hurry and am very hungry. I needed this to be quick.
You can actually “Chain” or have sequential commands in one line using PowerShell. To do this use a semicolon “;” in each statement or command.
What it does is execute each statement or command then brings back the cursor to you after the last command was executed.
Since Package Manager Console uses PowerShell. In fact, a simple get-command will display a long list of commands and modules (As I demonstrate… a long list, not a good idea without any filters on get-command on a development computer).
So using PowerShell’s Sub expressions, you can also chain your commands like enabling the migration and then adding an initial migration then finally update the database on one command inside package manager console.
It’s the little things.
It’s the 7th year! Thank you Microsoft, my fellow MVP and the PH Technical Communities!
– John Delizo, Microsoft MVP: Cloud and Datacenter Management
We just did our last technical session for the year 2015!
John Delizo Hosting and a quick demo on Docker and container technologies for deploying applications. And deploying applications to Windows Server 2016 Tech Preview.
Ren Narvaez on Microsoft Infrastructure Datacenter Security Today
Milo Pacamara on PH Emerging threat landscape and why upgrade
Felmar Tanada on Windows Server 2016 Preview: Nano Servers
Thank you for attending this session!
Thank you PHINUG for the invitation to talk about continuous integration with Visual Studio online and Microsoft Azure.
Warren Yu, Microsoft MVP: Application Lifecycle Management
Michael Peña, MSP Alumnus currently at Avanade
Jerome Punsalan’s lightning intermission number to perk up while eating.
Me (John) Taking questions from the audiences.
Again thank you and see you on the next PHINUG event!
PHINUG celebrates only tech talks and love for the cloud if you remember the 17th night of September!
The Philippine .NET Users Group (PHINUG), Microsoft Philippines, and Globe Labs presents another installment of MSDN Sessions, a monthly series of weekday after-office hours talks for software development professionals and enthusiasts of Microsoft developer technologies.
The event will be held on will be held on Thursday, September 17, 2015, 6:00 PMto 9:00 PM at Globe Telepark Valero, which could be found at Valero St. (near VA Rufino), Makati City.
Our speakers for the next session will be:
John Delizo, MVP for Software Packaging, Deployment, and Servicing, is going to talk about DevOps and Continuous Delivery using Visual Studio and Microsoft Azure, and discuss about how Microsoft Azure and Visual Studio Online helps developers in increasingly automated development, testing and deployment setups.
Warren Yu , MVP for Application Lifecycle Management will discuss aboutLeveraging VS ALM tools in a Lean Startup Environment. Warren will discuss how to get those products out in the leanest/meanest way possible.
We also have a lightning talk:
–Michael John Pena, MSP Alumnus will discuss about Portable Class Libraries.
Food and drinks will be served at the event. See you there!
So me and Edison talked at Microsoft’s Big Top festival in Blue Leaf Macapagal. We shared a slot to talked about the things we are doing in the past and how it is being done in the modern world with Microsoft Azure. Edison talking about open source on Microsoft Azure.
Certainly the days when we host our PHP and ASP websites with some hosting company or even in the office.
Dev-Ops were different back then, right now, it’s a one line switch from one container to another container thru PowerShell.
Switch production systems in seconds not days.
So there, Full development, Dev-Ops, Open Source, on one platform. Good times!
This is one of the reasons why I use WCF for all of my API projects.
There are a lot of ways to test a WCF Service Application, that we are using. I would to do a disclaimer that this may be appropriate for our use but may not for your scenarios. Moreover, what we are testing are the “functionality” of the methods exposed by the service and on tests we bypass most of WCF’s infrastructure.
The first thing you have to make sure is that the service is testable. This a default WCF implementation if you create it directly from the Visual Studio project template.
You wanted to create the service as an abstract class and implement it as a partial class, we do this so that we split most of our logic into multiple files and for this context, which is a unit test discussion, to not to be confused about the references. As you can see, there are 353 references to the partial class and these are all from unit tests. From this point forward, the red class is our partial class.
Then you add the Service Implementation project as reference to the unit test projects. Make sure to add your Message and Data Contracts as well.
When you create the unit tests, you call the partial classes (in red) and then use it as it was just another class. Test it, use data source if you wish.
Note that this bypasses all WCF infrastructure and is only used for tests like its functionality and removing the networking component. You will also notice that you are not spawning any IIS or host the WCF service to run test against it.
This now can be checked-in in TFS and do automated tests in your CI.
Happy CI-ing WCF Services!