zoukankan      html  css  js  c++  java
  • 发现个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; }
        }
  • 相关阅读:
    HDOJ1004
    HDOJ1001
    HDOJ1000
    HDOJ1003
    HDOJ1005
    新手如何正确使用CLion之输出hello world
    hihoCoder#1032 : 最长回文子串
    P3805 【模版】manacher算法(manacher)
    P1198 [JSOI2008]最大数(单调栈)
    P1351 联合权值
  • 原文地址:https://www.cnblogs.com/yanyuge/p/2612480.html
Copyright © 2011-2022 走看看