Cannot define class or member that utilizes dynamic because the compiler required type

前端 未结 3 2195
礼貌的吻别
礼貌的吻别 2021-02-20 11:47

I\'m using Facebook SDK C# Library in Asp.Net 3.5 Application. When I\'m trying to compile the code below give me the errors. As I know dynamic type using in 4.0 framework. So i

3条回答
  •  渐次进展
    2021-02-20 12:03

    If you don't want to use dynamic, you don't have to.

    var client = new FacebookClient();
    var me = client.Get("totten") as IDictionary;
    string firstName = (string)me["first_name"];
    string lastName = me["last_name"].ToString();
    

    This tutorial explains it more in depth

提交回复
热议问题