接口多适用类
2015-10-06 08:02
417 查看
public class IC
{
public int Id { get; set; }
}
public class test
{
public Bll bll=new Bll();
public void YouMath()
{
var model = new IC();
bll.Add(model);
}
}
public class Bll : IBll
{
public void Delete(int id)
{
throw new NotImplementedException();
}
public void Add(IC model)
{
throw new NotImplementedException();
}
public void Update(IC model)
{
throw new NotImplementedException();
}
public void Get(int id)
{
throw new NotImplementedException();
}
public void GetModelsByPage(int currPage, int pageSize)
{
throw new NotImplementedException();
}
public void DoSomeThin()
{
throw new NotImplementedException();
}
}
public interface IBll : IBaseBll<IC>
{
void DoSomeThin();
}
public interface IBaseBll<in T> where T : new()
{
void Delete(int id);
void Add(T model);
void Update(T model);
void Get(int id);
void GetModelsByPage(int currPage, int pageSize);
}
{
public int Id { get; set; }
}
public class test
{
public Bll bll=new Bll();
public void YouMath()
{
var model = new IC();
bll.Add(model);
}
}
public class Bll : IBll
{
public void Delete(int id)
{
throw new NotImplementedException();
}
public void Add(IC model)
{
throw new NotImplementedException();
}
public void Update(IC model)
{
throw new NotImplementedException();
}
public void Get(int id)
{
throw new NotImplementedException();
}
public void GetModelsByPage(int currPage, int pageSize)
{
throw new NotImplementedException();
}
public void DoSomeThin()
{
throw new NotImplementedException();
}
}
public interface IBll : IBaseBll<IC>
{
void DoSomeThin();
}
public interface IBaseBll<in T> where T : new()
{
void Delete(int id);
void Add(T model);
void Update(T model);
void Get(int id);
void GetModelsByPage(int currPage, int pageSize);
}
相关文章推荐
- Servlet学习
- Linux网络配置和网络诊断命令介绍
- 今天继续码~python的文件访问~
- 关于显著性检测的思考
- Python BIF 汇总
- Spring 系列: Spring 框架简介
- LintCode "Find Peak Element II"
- Leetcode Strobogrammatic Number
- 一个计算HBase表中行数的MapReduce程序
- 黑马程序员——基础知识——数组
- OSChina 周二乱弹 —— 早起傻一天
- notepad++使用技巧总结
- 数据结构实践——队列数组
- Java程序,求学员的平均成绩
- Java程序员常犯的10个错误
- Virtualbox 的 Kern Service 出问题了,怎么办?
- meinJava
- 微软发布Lumia系列手机是绝地反击之战
- *LeetCode-Contains Duplicate III
- 修改