• Knowledge


    1. web api 的get/post/delete/put/

      Get:retrieves the representation of the resource at specified uri

      PUT:updates a resource at a specified uri

      POST:creates a new resource

       DELETE: deletes a resource at a specified URI

    2. Serialization--hide null values

          a. XML Seralize----Create a function with the pattern ShouldSerialize{PropertyName} which tells the XmlSerializer if it should serialize the member or not. ---referenc link http://stackoverflow.com/questions/5818513/xml-serialization-hide-null-values

     for example:

    public class Person
    {
      public string Name {get;set;}
      public int? Age {get;set;}
      public bool ShouldSerializeAge()
      {
        return Age.HasValue;
      }
    }

    Serialized with the following code

    Person thePerson = new Person(){Name="Chris"};
    XmlSerializer xs = new XmlSerializer(typeof(Person));
    StringWriter sw = new StringWriter();
    xs.Serialize(sw, thePerson);
    

    Results in the followng XML - Notice there is no Age

    <Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Name>Chris</Name>
    </Person>
    

    b. DataContractSerialize --http://stackoverflow.com/questions/13506630/datacontractjsonserializer-to-skip-nodes-with-null-values

    c. JsonConvcert ---hide Null values, reference link ----http://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_NullValueHandling.htm
    --http://stackoverflow.com/questions/6507889/how-to-ignore-a-property-in-class-if-null-using-json-net

    3. SQL中 varchar 和nvarchar的区别
    varchar(n),长度为n个字节的可变长度且非unicode的字符数据,n必须是介于一个1和8000之间的数值,存储大小为数据数据的字符节的实际长度,而不是n个字节
    nvarchar(n),包含n个字符的可变长度的unicode的字符数据,n的值必须介于1与4000之间,字节的存储大小是所输入字符个数的两倍
    一般来说,如果含有中文字符,用nchar/nvarchar,如果纯英文和数字,用char/varchar
    Note:正常情况下,用varchar也可以存储中文字符,但是如果遇到操作系统是英文操作系统并且对中文字体的支持不全面时,在sql server存储中文字符varchar就会出现乱码??,所以使用
    nvarchar的一个好处就是在判断字符串的时候可以不需要考虑中英文的字符差距。

     4. SQL 操作xml

    https://www.mssqltips.com/sqlservertip/2738/examples-of-using-xquery-to-update-xml-data-in-sql-server/

    http://www.cnblogs.com/youring2/archive/2008/11/27/1342288.html

    5. Linq

    https://msdn.microsoft.com/zh-cn/library/bb548541(VS.95).aspx

    6 Integrated Security:

    true:   将使用当前的windows登陆账号进行身份验证

    false:将在连接中指定用户ID和密码

    7. float 浮动 div不随浏览器分辨率/缩放 大小而 位置发生变化

    http://blog.csdn.net/z69183787/article/details/23326063

    8. 怎么从html数据中删除不需要的标签

     https://stackoverflow.com/questions/12787449/html-agility-pack-removing-unwanted-tags-without-removing-content

    https://stackoverflow.com/questions/18153998/how-do-i-remove-all-html-tags-from-a-string-without-knowing-which-tags-are-in-it

    https://stackoverflow.com/questions/23268119/remove-html-tags-from-a-string-except-a-in-asp-net

    日期格式转换:

    https://www.cnblogs.com/wudi521/p/5855680.html

    9. AutoResetEvent: 被用来在两个线程之间进行信号发送。

    http://www.cnblogs.com/czytcn/p/8085071.html

    http://dotnetpattern.com/threading-autoresetevent

    10. ManualResetEvent: 一种线程同步技术, 被用于在两个或多个线程间进行线程信号发送。

    http://www.cnblogs.com/czytcn/p/8085378.html

  • 相关阅读:
    Django学习-9-ORM多对多操作
    Django学习-8-模板渲染的一些特性
    Django学习-7-ORM操作
    Django学习-6-路由系统
    Hadoop 知识
    最全的Spark基础知识解答
    windows server 2008 R2 远程连接用户数修改
    Windows 2008 R2 SP1部署WSUS 3.0 SP2
    Windows Server2008 R2 设置NAT 让Hyper-V连接Internet
    免费好用的Microsoft iSCSI Software Target 3.3
  • 原文地址:https://www.cnblogs.com/lovemm/p/6769616.html
Copyright © 2020-2023  润新知