You add new table to database.
You want to quickly create appropriate POCO class uses solely for ORM (NPOCO) or any of your own.
How?
http://stackoverflow.com/questions/10136520/how-to-automatically-create-model-from-database-using-petapoco-library
Create console app.
Add app.config
Add connection string
Install NuGet package "Peta Poco" (Topten Software, ver 5.0.1 but any will do).
I'm not sure do you need to rebuild.
Peta poco should generate Models / Generated / Database.tt
Right click Database.tt and "Run custom toll":
Voila !
Under Database.tt you will find Database.cs. There you'll find all your Poco classes.
Watch it !
Carefully check what is generated. This template from Peta Poco is not perfected but it should do job for most common scenarios.
Sep 19, 2013
Sep 17, 2013
Visual Studio - tracking multiple web projects in single instance
I have 2 webapi's in one solution.
They communicate with eachother.
Question is how to debug both of them in same time.
Select solution, not project!
Go to properties of solution and select Startup project.
Choose multiple projects as startup.
Now VS will start multiple projects in standalone W3WP processes and all debug breakpoints will be loaded for all projects.
They communicate with eachother.
Question is how to debug both of them in same time.
Select solution, not project!
Go to properties of solution and select Startup project.
Choose multiple projects as startup.
Now VS will start multiple projects in standalone W3WP processes and all debug breakpoints will be loaded for all projects.
Sep 12, 2013
Building url smartly
Keep forgetting so here it is:
http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx
Smart way to concatenate absolute and relative paths in web path.
http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx
Smart way to concatenate absolute and relative paths in web path.
Sep 3, 2013
Web server path when out of http context
When running a service under IIS, the HttpContext.Current object is not available, so HttpContext.Current.Server.MapPath will fail.
http://tim-stanley.com/post/use-hostingenvironmentmappath/
http://dteixeira.com/684/alternative-server-mappath/
http://tim-stanley.com/post/use-hostingenvironmentmappath/
http://dteixeira.com/684/alternative-server-mappath/
Subscribe to:
Posts (Atom)