惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Engineering at Meta
Engineering at Meta
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
D
Docker
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
IT之家
IT之家
V
V2EX
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
F
Full Disclosure
P
Proofpoint News Feed
B
Blog RSS Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
B
Blog
Webroot Blog
Webroot Blog
腾讯CDC
T
Troy Hunt's Blog
T
Tailwind CSS Blog
H
Heimdal Security Blog
AWS News Blog
AWS News Blog
G
Google Developers Blog
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
A
About on SuperTechFans
SecWiki News
SecWiki News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
M
MIT News - Artificial intelligence
大猫的无限游戏
大猫的无限游戏
美团技术团队
L
LangChain Blog

博客园 - 山顶洞外人

k8s部署dengine-3.3.6.9 wsl 磁盘 SQL 写法对比 关于达梦8管理工具执行多行sql语法错误问题 idea 中无法连接 sql server 数据库,报错 [08S01] 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接 TransactionScope 图片扩容 已将此 订阅标记为不活动,必须将其重新初始化。需要删除NoSync 订阅,然后重新创建它们 visual studio 2017 将winform 打包成 msi 安装文件 漏洞处理 阿里云物联网测试 net core3.1 + electron 9.31.2 项目初始化 delete in 事故清表 sql 脚本执行时间 webapi filter 分组后条件查询 一行拆多行 有关数据库锁表 order by 排序的数字异常
从C#接口的属性获取多个实现类中字段的值
山顶洞外人 · 2024-02-22 · via 博客园 - 山顶洞外人
        private List<string> GetImplName()
        {
            List<string> ls = new List<string>();

            var types = AppDomain.CurrentDomain.GetAssemblies()
                        .SelectMany(a => a.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IBaseContainer))))
                        .ToArray();
            foreach (var v in types)
            {
                object ct = Activator.CreateInstance(v);
                string name = (string)v.GetProperty("Name").GetValue(ct, null);
                ls.Add($"{name}");
            }
            return ls;
        }
    public interface IBaseContainer
    {
        /// <summary>
        /// 类型名字,属性访问器,访问实现类中的_name字段
        /// </summary>
        string Name { get; }

        /// <summary>
        /// 数据保存
        /// </summary>
        void Save();
        /// <summary>
        /// 数据组合构建
        /// </summary>
        void DataBuild(SlnClass slnClass);
    }
    public class DMImpl : IBaseContainer
    {
        private string _name = "DM";

        public string Name => _name;

        public void DataBuild(SlnClass slnClass)
        {
            throw new NotImplementedException();
        }

        public void Save()
        {
            throw new NotImplementedException();
        }

    }