zoukankan      html  css  js  c++  java
  • 接口多适用类(泛型)


        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);
        }

  • 相关阅读:
    腾讯微博模拟登录
    python 列表复制给另一个列表,改值两个列表均会改变(备忘)
    python3 re.compile中含有变量
    python3 pyinstaller生成exe文件过程问题解决记录
    python3 不知文件编码情况下打开文件代码记录
    python TKinter部分记录
    python3 列表去除重复项保留原序
    python 字典排序
    python 字典中 重复值去除
    python 一些方法函数
  • 原文地址:https://www.cnblogs.com/change4now/p/4856657.html
Copyright © 2011-2022 走看看