Helping you solve those tough coding problems!
Learn some great web development and web design tips and techniques through recipes that clearly define the problem being solved with a working solution.
Popular Tags: cakephp | theory | optimization | javascript-development | css | asp-net | jquery-development | ajax | sql | php-development

Search:
Follow @endyourif rss Facebook LinkedIn

Entity Framework's Code-First with an ObjectContext Entity Framework's Code-First with an ObjectContext

Published on Mar 20, 2019 by Jamie Munro

If the following blog interests you, it's probably because you're using Entity Framework with a Code-First approach and whatever it is you are trying to do *must* use an ObjectContext instead of the standard DbContext. I'm sure, like me, you thought this shouldn't be too hard. Then you started hitting roadblocks like, Metadata is required in your connection string. What's metadata? This is only needed in Database-First so you can tell the framework where your edmx and other definition files are, so why do I need this with Code-First, I don't have these files?

This was definitely my first reaction as well. So after much trial-and-error and research, I have the solution!

Read more >

Tags: ASP.NET | c# | entity framework

Posting form variables that are not strongly typed with MVC Posting form variables that are not strongly typed with MVC

Published on Mar 17, 2019 by Jamie Munro

In a lot of the MVC 3 examples that are available on the Internet today, they are quite typically strongly typed to a model, e.g. public ActionResult LogOn(LogOnModel model, string returnUrl).

This is extremely useful for the validation abilities and many other aspects; however, there are times when some or all of the data is not strongly typed; then what do you do? Read on for two different approaches.

Read more >

Tags: ASP.NET | mvc

Pass Model or Form Data with MVC when redirecting Pass Model or Form Data with MVC when redirecting

Published on Mar 13, 2019 by Jamie Munro

Have you ever wanted to pass form data or perhaps even a full model from one action to another through a RedirectToAction? By adding a new library package from NuGet, this can be accomplished with a few small changes to your controllers.

The first thing that needs to be done is to install the package through the NuGet package manager. Inside of Visual Studio, with the your MVC project selected select Tools -> Library Package Manager -> Add Library Package ReferenceÖ On the left hand side, select the Online button. Then, in the search field, type MvcContrib and install the base package.

Read more >

Tags: ASP.NET | c# | mvc

Creating your own UrlHelper Extension with MVC Creating your own UrlHelper Extension with MVC

Published on Mar 9, 2019 by Jamie Munro

When you have a website with a lot of static content: images, Javascript, CSS, etcÖ you will find yourself constantly typing out the same path information with the exception of the name of the actual file. Creating a class extension to the UrlHelper can help greatly reduce your development efforts with a few simple additions.

Read more >

Tags: urlhelper | ASP.NET | Theory | mvc

Compile Views with your MVC project Compile Views with your MVC project

Published on Mar 6, 2019 by Jamie Munro

Most ASP.NET developers will use Visual Studio to build their projects. The program has evolved quite a bit over the past few years. Including excellent features like Intellisense inside of ASP.NET MVC view files as well as some error detection in these, by default, not compiled elements. However, when ViewBag variables are used or other run-time specific elements, Visual Studio is unable to determine potential errors in these view files. Have no fear though; there is a nice and simple solution to help solve this problem!

Read more >

Tags: ASP.NET | c#

C# Truncate String Extension C# Truncate String Extension

Published on Feb 28, 2019 by Jamie Munro

MVC: Accessing the RouteData inside of your C# code MVC: Accessing the RouteData inside of your C# code

Published on Feb 27, 2019 by Jamie Munro

C# HtmlExtension to display SVGs C# HtmlExtension to display SVGs

Published on Feb 16, 2019 by Jamie Munro

C# Improving string.IsNullOrEmpty readability C# Improving string.IsNullOrEmpty readability

Published on Feb 5, 2019 by Jamie Munro

C# OutputCache with subdomains C# OutputCache with subdomains

Published on May 4, 2018 by Jamie Munro

C# Convert date from UTC to EST C# Convert date from UTC to EST

Published on Jun 7, 2017 by Jamie Munro

How to return a CSV from ASP.NET Web API using C# How to return a CSV from ASP.NET Web API using C#

Published on May 4, 2017 by Jamie Munro

Unit Testing Data Validation with MVC Unit Testing Data Validation with MVC

Published on May 11, 2015 by Jamie Munro

Removing Data Validation from MVC Controllers Removing Data Validation from MVC Controllers

Published on May 6, 2015 by Jamie Munro

Integrating Automapper with an MVC Result Filter Integrating Automapper with an MVC Result Filter

Published on May 4, 2015 by Jamie Munro

ASP.NET MVC 5 with Bootstrap and Knockout.js ASP.NET MVC 5 with Bootstrap and Knockout.js

Published on Apr 21, 2015 by Jamie Munro

Speeding up my unit tests Speeding up my unit tests

Published on Apr 28, 2014 by Jamie Munro

Advanced Automatic Ninject Bindings Advanced Automatic Ninject Bindings

Published on Jan 13, 2014 by Jamie Munro

Automatic Ninject Bindings Automatic Ninject Bindings

Published on Jan 7, 2014 by Jamie Munro

Iím hooked on test-driven development (TDD) with a Fizzbuzz C# Example Iím hooked on test-driven development (TDD) with a Fizzbuzz C# Example

Published on Aug 6, 2013 by Jamie Munro

Automapper Performance Testing Automapper Performance Testing

Published on May 27, 2013 by Jamie Munro

Why the Repository Pattern Why the Repository Pattern

Published on May 20, 2013 by Jamie Munro

Entity Framework Beginnerís Guide Done Right Entity Framework Beginnerís Guide Done Right

Published on May 13, 2013 by Jamie Munro

My First Experiences with Kinect for Windows - @KinectWindows My First Experiences with Kinect for Windows - @KinectWindows

Published on Mar 5, 2013 by Jamie Munro

Javascript, the Back Button, and Windows Phone 8 Development Javascript, the Back Button, and Windows Phone 8 Development

Published on Feb 18, 2013 by Jamie Munro

The Best Way to Prevent SQL Injection The Best Way to Prevent SQL Injection

Published on Sep 19, 2012 by Jamie Munro

What I Learned This Summer What I Learned This Summer

Published on Sep 7, 2012 by Jamie Munro

A Simple But Effective Speed Comparison A Simple But Effective Speed Comparison

Published on Sep 4, 2012 by Jamie Munro

MVC 3 Routing Example MVC 3 Routing Example

Published on Oct 17, 2011 by Jamie Munro

20 Recipes for Programming MVC 3 20 Recipes for Programming MVC 3

Published on Oct 12, 2011 by Jamie Munro

20 Recipes for Programming MVC 3 20 Recipes for Programming MVC 3

Published on Oct 12, 2011 by Jamie Munro

ToLower-ToUpper and the CurrentCulture.CultureInfo ToLower-ToUpper and the CurrentCulture.CultureInfo

Published on Aug 8, 2011 by Jamie Munro

ToLower-ToUpper and the CurrentCulture.CultureInfo ToLower-ToUpper and the CurrentCulture.CultureInfo

Published on Aug 8, 2011 by Jamie Munro