• 接口多适用类(泛型)



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

  • 相关阅读:
    krakend 扩展开发概述
    varnish/api-gateway-benchmarks api gateway 性能压测工具
    krakend 加速配置工具
    krakend 支持发布订阅后端
    krakend 消费amqp mq 消息
    krakend cache 后端请求
    krakend 请求流量镜像的处理
    krakend 请求&&相应的检查
    krakend 的静态proxy
    krakend 的串行proxy
  • 原文地址:https://www.cnblogs.com/change4now/p/4856657.html
Copyright © 2020-2023  润新知