1、在WCF.Controller中定义了一个UserModel,标记为①

2、在WCF.Controller.Model中定义了一个UserModel(同上,namespace不同),标记为②

3、在WCF.Controller中引用UserModel,没有任何疑问,引用的是①中的UserModel

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc; namespace WCF.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
UserModel userModel = new UserModel();
return View();
} }
} namespace WCF.Controllers
{
public class UserModel
{
public int UserID { get; set; }
public string UserName { get; set; }
}
} namespace WCF.Controllers.Model
{
public class UserModel
{
public int UserID { get; set; }
public string UserName { get; set; }
}
}

4、在WCF.Controller.Model中引用UserModel,没有任何疑问,引用的是②中的UserModel

 namespace WCF.Controllers.Model
{
public class HomeController : Controller
{
public ActionResult Index()
{
UserModel userModel = new UserModel();
return View();
} }
}

5、在WCF.Controller.Model.SM中引用UserModel,应该和你猜的一致,会向上搜索,引用的是②中的UserModel

 namespace WCF.Controllers.Model.SM
{
public class HomeController : Controller
{
public ActionResult Index()
{
UserModel userModel = new UserModel();
return View();
} }
}

6、删除②中定义的UserModel,引用的将会是①中的UserModel

最新文章

  1. 机器学习PR:感知机模型
  2. Android基于XMPP的即时通讯2-文件传输
  3. vim下使用ctags+taglist
  4. PHP包含文件函数include、include_once、require、require_once区别总结
  5. 不同tomcat配置不同的jdk
  6. Object-C 内存管理及对象
  7. JS模块化编程之AMD规范(转)
  8. Spring MVC Controller中GET方式传过来的中文参数会乱码的问题
  9. 【转】VC++消息钩子编程
  10. LinkButton和HyperLink的页面跳转用法
  11. Bone Collector(01背包+记忆化搜索)
  12. mybatis至mysql插入一个逗号包含值误差
  13. Windows 8 – Reason 442: Failed to enable Virtual Adapter
  14. Oracle的基本学习(二)—基本查询
  15. request.getParameter()及解决数据库中文乱码问题——实习第七天
  16. 【MVC】会员注册/登录,普通验证,会员名是否注册Ajax验证以及会员邮件验证实现原理
  17. 基于Mybatis的Dao层的开发
  18. go跨平台编译
  19. PSU/OPATCH/OJVM下载页面及安装方式(最实用版)
  20. 图片轮滚形式A

热门文章

  1. nginx+tomcat+redis的集群+session共享
  2. javascript util.js
  3. [算法] 数据结构之AVL树
  4. HTML之布局position理解
  5. php 添加redis扩展(二)
  6. [转]Neutron演进
  7. 【转】Java集合框架综述
  8. SNM2无法编辑HostGroup项
  9. angularjs中ng-route和ui-router简单用法的代码比较
  10. 【转】 SQL 2005 try catch