Skip to content

Instantly share code, notes, and snippets.

View stormwild's full-sized avatar
🏠
Working from home

Alexander R Torrijos stormwild

🏠
Working from home
View GitHub Profile

Multiple types were found that match the controller named 'Controller name'.

In Application\App_Start\RouteConfig.cs, add a fourth parameter for namespaces:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    namespaces: new[] { "AskPLDT.Controllers" }

);

		// container.Register(typeof(IRepository<>), typeof(AzureRepository<>)).AsMultiInstance();
		// container.Register(typeof (IService<TEntity>), typeof ()).AsPerRequestSingleton();
		
		// Unity -- container.RegisterType<IUnitOfWorkAsync, UnitOfWork>(new PerRequestLifetimeManager())

		//container.Register(typeof(IDataContextAsync), typeof(SanlaanContext)).AsPerRequestSingleton();
		//container.Register(typeof (IUnitOfWorkAsync), typeof (UnitOfWork)).AsPerRequestSingleton();

//container.Register(typeof(IRepositoryAsync<>), typeof(Repository<>)).AsPerRequestSingleton();

using System;
using System.Globalization;
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{

How the user came to find out about the site is described as "How Heard" and usually used within the system as an HowHeard object or variable name.

A better name or description within the system could be ReferralSource.

public class RegistrationViewModel {
  public string HowHeard { get; set; } // acceptable
  public string ReferralSource { get; set; } // better
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@stormwild
stormwild / Controller.cs
Created December 10, 2011 11:45
To get a list of errors in the model state
[HttpPost]
public ActionResult Edit(ViewModel viewModel)
{
if (ModelState.IsValid)
{
repository.SaveModel(viewModel);
TempData["message"] = "Changes have been saved";
return RedirectToAction("Index");
}
else
@stormwild
stormwild / new_gist_file.css
Created September 29, 2015 07:40 — forked from spigists/new_gist_file.css
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }