zoukankan      html  css  js  c++  java
  • 从dataReader到Entity转化时利用Reflect示例

    Using System.Reflection
    #region    Product
            internal static Downmoon.Product.Framework.Components.Product LoadSingleProduct(IDataReader reader)
            {
                Downmoon.Product.Framework.Components.Product m_Product = new Downmoon.Product.Framework.Components.Product();
                Type type = m_Product.GetType();
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    if (!reader.IsDBNull(i))
                    {
                        try { type.InvokeMember(reader.GetName(i), BindingFlags.Default | BindingFlags.SetProperty, null, m_Product, new object[] { reader.GetValue(i) }); }
                        catch (MissingMemberException exception) { System.Diagnostics.Debug.WriteLine(exception.Message); }
                    }
                }
                return m_Product;
            }
            #endregion
  • 相关阅读:
    check2
    LYF模板连接.txt
    mvc中的表现和数据分离怎么理解?
    node中websocket的使用
    vue随笔
    python安装Django常见错误
    node中的session的使用
    为什么很多IT公司不喜欢进过培训机构的人呢
    vue数据交互
    vuecli的服务代理
  • 原文地址:https://www.cnblogs.com/amylis_chen/p/1966309.html
Copyright © 2011-2022 走看看