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/
Jul 23, 2013
Javascript OO concepts
Good reading for getting deeper picture on what is JSON and why are function's first class citizens in Javascript.
Must read for any use of JQuery past the basics.
MANNING - Bear Bibeault, Yehuda Katz "JQuery in Action" - appendix: JavaScript that you need to know but might not!
Must read for any use of JQuery past the basics.
MANNING - Bear Bibeault, Yehuda Katz "JQuery in Action" - appendix: JavaScript that you need to know but might not!
Jul 18, 2013
Repository pattern
During my experience as .NET developer I've embraced "Repository" pattern from senior developers.
This is rarely used and raises question mark on people faces.
Hence here is not to forget guy who speaks more theoretically on matter.
http://www.codeproject.com/Articles/586364/UsingplusASP-NetplusWebAPIpluswithplusWebplusForms
This is rarely used and raises question mark on people faces.
Hence here is not to forget guy who speaks more theoretically on matter.
http://www.codeproject.com/Articles/586364/UsingplusASP-NetplusWebAPIpluswithplusWebplusForms
Jul 17, 2013
IE7 and IE8 Control Focus issue on Page Load
This is here so I don't forget it ...
http://carstent.com/2009/12/31/ie-7-and-8-control-focus-issue-on-page-load/
http://carstent.com/2009/12/31/ie-7-and-8-control-focus-issue-on-page-load/
Subscribe to:
Posts (Atom)