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

  • 相关阅读:
    线程池的优雅关闭实践
    InheritableThreadLocal原理解析
    线程池踩坑
    两个线程通讯(生产-卖面包问题)
    谈谈redis的热key问题如何解决
    中国软件杯选题A1数据智能分析报告系统
    《程序员的思维修炼》读后感
    《算法导论》读后感
    《重构》读后感
    《代码整洁之道》读后感
  • 原文地址:https://www.cnblogs.com/change4now/p/4856657.html
Copyright © 2011-2022 走看看