实例化继承了接口:
namespace Air.Common.Air
{
public class AirCityEntity : IAirCityEntity
{
public int Id { get; set; }
public String Name { get; set; }
public String Code{get;set;}
}
}接口namespace Air.Common.Air.Interface
{
public interface IAirCityEntity
{
int Id { get; set; }
String Name { get; set; }
String Code { get; set; }
}
}
有什么用??/????/希望大家指点下``给个很直观的思想```
谢谢啊``````
namespace Air.Common.Air
{
public class AirCityEntity : IAirCityEntity
{
public int Id { get; set; }
public String Name { get; set; }
public String Code{get;set;}
}
}接口namespace Air.Common.Air.Interface
{
public interface IAirCityEntity
{
int Id { get; set; }
String Name { get; set; }
String Code { get; set; }
}
}
有什么用??/????/希望大家指点下``给个很直观的思想```
谢谢啊``````
解决方案 »
- C# SQL2000 查询%%请教
- 数据库中的路径读出后用trim去不掉空格,要怎么办呀?
- webBrowser 奇怪的问题
- 什么叫基元数据类型
- Socket编程停止服务时老是异常,不知是哪里出了错,跪请高手指点!
- VB.NET版的100分绝对高难度问题,能解决的进来领分,不能解决的进来顶一下,谢谢各位兄弟捧场
- 要用C#做一个类似电子地图查找的软件.请问需要注意些什么,有做的吗?帮忙.毕业设计
- 说是转换无效`搞老大半天了`就是没咋见效`如有高手看到`请你救救我了
- 将pdf转换为swf并显示在网页中
- 炒股软件大智慧的模式是三层还是两层,用C#能开发这样的程序吗?
- C# picturBox控件保存图片
- access查询1天时间段内的数据
public IUserEntity GetEntity()
{
var entity = new UserEntity();
var cookie = System.Web.HttpContext.Current.Request.Cookies[PageData.USER_ID];
if (cookie != null)
{
Int32 uid = -1;
if (Int32.TryParse(cookie.Value, out uid))
{
entity.UserId = uid;
}
else
{
return null;
}
}
{
private IAirCityEntity _ITest;
}class Test2
{
private AirCityEntity _Test;
}Test2依赖具体的AirCityEntity ,Test1 依赖抽象的接口IAirCityEntity
Test1 的实现可以脱离AirCityEntity 类