• 发现个EF的疑似Bug


    定义下述实体,跟SQL语句交互的过程中,发现EF始终Map不上NickName属性,排查后发现注释掉LastTimestamp后居然就可以了……在我的网站项目中一直都是如此。后来新建了个测试项目、新建了个测试表,发现无法重现,汗~~~~~~

    初步推测,感觉像是EF底层用的是C++直接按照对象在内存中的布局信息去映射,而不是C#的反射来赋值。具体怎么搞的目前还不知道,先记录下来,以后有机会的话看看吧。

     


    public class Comment
        {
            public long CommentId
            {
                get;
                set;
            }
            public long PhotoId
            {
                get;
                set;
            }

            public int Commentator
            {
                get;
                set;
            }
            public bool Recyled
            {
                get;
                set;
            }
            public string Content
            {
                get;
                set;
            }
            public DateTime CreateTime
            {
                get;
                set;
            }
            public bool IsShow
            {
                get;
                set;
            }

            //public byte[] LastTimestamp
            
    //{
            
    //    get;
            
    //    set;
            
    //}

            public int Floor
            {
                get;
                set;
            }

            public string NickName
            {
                get;
                set;
            }

            public long TotalCount { getset; }
        }
  • 相关阅读:
    Axure学习二:基础教程
    Axure 学习一:基础知识详解参考文档
    iOS 加载动态库报错问题
    iOS 9 之 Spotlight框架
    iOS 之 新功能、扩展
    mysql慢查询
    php curl多线程抓取网页
    php读取qqwry.dat ip地址定位文件的类
    php比较加赋值语句
    yaf在windows7下32位的安装教程
  • 原文地址:https://www.cnblogs.com/yanyuge/p/2612480.html
Copyright © 2020-2023  润新知