zoukankan      html  css  js  c++  java
  • 实体写到redis写不进去--误把类当成实体类

    之前一直都把实体写入redis都没有问题,今天再次这样干,结果却是怎么写都写不进去,redis里的值老是为空

    最后才发现把类当成了实体类,当然写不进去了。

    把类:

    /// <summary>
        /// Redis实体
        /// </summary>
        public class Redis
        {
            public string tdtype;//tdtype
            public string tdaccount;//tdaccount
            public string brokerid;//brokerid
            public string userid;//userid
            public string tdpswd;//tdpswd
            public string auth_type;//auth_type
            public string safety_info;//safety_info
            public string secret_key_info;//secret_key_info
        }

    当成实体:

        /// <summary>
        /// Redis实体
        /// </summary>
        public class Redis
        {
            /// <summary>
            ///    tdtype
            /// </summary>
            public string tdtype { get; set; }
            /// <summary>
            /// tdaccount
            /// </summary>
            public string tdaccount { get; set; }
            /// <summary>
            ///    brokerid
            /// </summary>
            public string brokerid { get; set; }
            /// <summary>
            /// userid
            /// </summary>
            public string userid { get; set; }
            /// <summary>
            ///    tdpswd
            /// </summary>
            public string tdpswd { get; set; }
            /// <summary>
            ///    auth_type
            /// </summary>
            public string auth_type { get; set; }
            /// <summary>
            ///    safety_info
            /// </summary>
            public string safety_info { get; set; }
            /// <summary>
            ///    secret_key_info
            /// </summary>
            public string secret_key_info { get; set; }

        }

    问题找到了,数据终于可以正常写入

    多么痛的领悟!!!!

  • 相关阅读:
    obj文件可视化
    TypeError: unsupported operand type(s) for +: 'range' and 'range'
    ubuntu截屏软件shutter
    什么是Redis缓存穿透、缓存雪崩和缓存击穿
    在 ASP.NET Core 5.0 中访问 HttpContext
    如何使用带有BOM的UTF8编码的C#中的GetBytes()?
    ASP.NET Core 5.0 Web API 自动集成Swashbuckle
    ASP.NET Core 5.0 的新增功能
    面试被问到SQL | delete、truncate、drop 有什么区别?
    3个值得学习和练手的.net企业级开源项目,强烈推荐
  • 原文地址:https://www.cnblogs.com/wdkshy/p/4484158.html
Copyright © 2011-2022 走看看