{"id":1974,"date":"2012-12-13T12:48:00","date_gmt":"2012-12-13T12:48:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2012\/12\/13\/the-new-facebook-application-template-and-library-for-asp-net-mvc\/"},"modified":"2022-08-10T01:40:28","modified_gmt":"2022-08-10T08:40:28","slug":"the-new-facebook-application-template-and-library-for-asp-net-mvc","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/the-new-facebook-application-template-and-library-for-asp-net-mvc\/","title":{"rendered":"The new Facebook application template and library for ASP.NET MVC"},"content":{"rendered":"<p>If you\u2019re looking to build a Facebook App using ASP.NET MVC, then you\u2019re in the right place. With the release of <a href=\"http:\/\/www.asp.net\/vnext\/overview\/fall-2012-update\"><strong>ASP.NET and Web Tools 2012.2<\/strong><\/a><strong>,<\/strong> we\u2019ve added lots of updates to our <strong>Facebook Application template<\/strong> <strong>and<\/strong> <strong>library<\/strong> since we first introduced it in the Preview.<\/p>\n<p>The library, <a href=\"http:\/\/nuget.org\/packages\/Microsoft.AspNet.Mvc.Facebook\"><strong>Microsoft.AspNet.Mvc.Facebook<\/strong><\/a>, can be downloaded as an independent NuGet package and it contains everything you need to create a Facebook Canvas application using ASP.NET MVC. It\u2019s already included by default in the Facebook Application template to give you a quick jump start on building a <a href=\"https:\/\/developers.facebook.com\/docs\/guides\/canvas\/\">Canvas Page<\/a>.<\/p>\n<p>Please refer to the <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=269921\"><strong>tutorial<\/strong><\/a> for instructions on how to setup the Facebook Application template. In this post I\u2019ll mainly focus on the design\/API changes that we made from the Preview to RC. This will give you a pretty good idea of how the new APIs work in the updated Facebook Application template.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/1258.image_thumb_5C2BC843.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/1258.image_thumb_5C2BC843.png\" width=\"554\" height=\"368\" \/><\/a><\/p>\n<h2>Introducing FacebookContext<\/h2>\n<p>Before RC, we used to model bind the User and other Facebook objects as parameters. The problem with model binding these parameters is that we needed to call Facebook Graph API to get the values and the model binders in MVC don\u2019t support async. That\u2019s why in RC, we\u2019re replacing them with a FacebookContext parameter from which you can access the user ID, access token and the parsed signed request. More importantly, the FacebookContext has an instance of the <a href=\"http:\/\/csharpsdk.org\/docs\/web\/getting-started\">FacebookClient<\/a> which can be used to make asynchronously calls to Facebook to get the values for the User and other Facebook objects.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/6204.image_thumb_70D71C59.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/6204.image_thumb_70D71C59.png\" width=\"274\" height=\"193\" \/><\/a><\/p>\n<p>The instance of FacebookClient is populated with the required information such as AppId, AppSecret and AccessToken, so it\u2019s ready to use.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> async Task&lt;ActionResult&gt; Index(FacebookContext context)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">if<\/span> (ModelState.IsValid)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        MyAppUser user = await context.Client.GetCurrentUserAsync&lt;MyAppUser&gt;();<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #0000ff\">return<\/span> View(user);<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">return<\/span> View(<span style=\"color: #006080\">&quot;Error&quot;<\/span>);<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h2>FacebookClient Extensions<\/h2>\n<p>We\u2019ve added a number of extension methods to <a href=\"https:\/\/github.com\/facebook-csharp-sdk\/facebook-csharp-sdk\/blob\/master\/Source\/Facebook\/FacebookClient.cs\">FacebookClient<\/a> to make the common tasks, such as getting the current user and his\/her friends, simpler.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/5224.image_thumb_74753736.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/5224.image_thumb_74753736.png\" width=\"554\" height=\"213\" \/><\/a><\/p>\n<p>In fact, most of the extension methods above are based on <strong>GetFacebookObjectAsync&lt;TFacebookObject&gt;<\/strong>(string objectPath). If you\u2019re familiar with Facebook C# SDK, you might be wondering how it is different from GetTaskAsync&lt;TResult&gt;(string path). Well, the main difference between them is that GetFacebookObjectAsync&lt;TFacebookObject&gt;(string objectPath) will automatically generate \u201cfields\u201d query parameter when making the request so you get back only the properties you need. It reduces the payload size and sometime this can be quite significant. For example, if you have the following type named \u201cMyUser\u201d.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Id { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Birthday { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>GetFacebookObjectAsync&lt;MyUser&gt;(\u201cme\u201d) will get back something like the following.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;id&quot;<\/span>: <span style=\"color: #006080\">&quot;1234567&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;birthday&quot;<\/span>: <span style=\"color: #006080\">&quot;01\/01\/2000&quot;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>but GetTaskAsync&lt;MyUser&gt;(\u201cme\u201d) will get back the full payload. The difference can be even bigger when you\u2019re retrieving a list of friends.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>{  <\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;id&quot;<\/span>: <span style=\"color: #006080\">&quot;1234567&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;first_name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;middle_name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;last_name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;link&quot;<\/span>: <span style=\"color: #006080\">&quot;https:\/\/www.facebook.com\/sample&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;username&quot;<\/span>: <span style=\"color: #006080\">&quot;sample&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;birthday&quot;<\/span>: <span style=\"color: #006080\">&quot;01\/01\/2000&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;location&quot;<\/span>: <\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #006080\">&quot;id&quot;<\/span>: <span style=\"color: #006080\">&quot;123456789&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #006080\">&quot;name&quot;<\/span>: <span style=\"color: #006080\">&quot;Redmond, Washington&quot;<\/span>  <\/pre>\n<p><!--CRLF--><\/p>\n<pre>    },<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;quotes&quot;<\/span>: <span style=\"color: #006080\">&quot;Very long quotes...................&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;gender&quot;<\/span>: <span style=\"color: #006080\">&quot;male&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;email&quot;<\/span>: <span style=\"color: #006080\">&quot;sample@sample.com&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;timezone&quot;<\/span>: -4,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;locale&quot;<\/span>: <span style=\"color: #006080\">&quot;en_US&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;verified&quot;<\/span>: <span style=\"color: #0000ff\">true<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;updated_time&quot;<\/span>: <span style=\"color: #006080\">&quot;2012-10-11T00:25:53+0000&quot;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>Being able to automatically generate the \u201cfields\u201d query parameter also makes it easier to retrieve <em><a href=\"https:\/\/developers.facebook.com\/docs\/reference\/api\/\">connections<\/a> <\/em>(Picture, Friends, Likes, etc) as fields. For instance, you can get back the user information and what user Likes (a <em>connection<\/em>) in a single request by defining the types below. GetFacebookObjectAsync&lt;MyUser&gt; will automatically take care of generating the appropriate \u201cfields\u201d query to include the Likes <em>connection <\/em>(assuming you have user_likes permission).<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Id { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Birthday { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookGroupConnection&lt;Like&gt; Likes { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> Like<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Category { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h2>Modeling Facebook Objects<\/h2>\n<p>Unlike before, where your Facebook user\/object types were required to derive from FacebookUser\/FacebookObject, now you can use any POCO type as long as it contains public properties with the matching name. We\u2019ll deserialize the Facebook response using Json.NET. For example, the following Facebook response for a user will match the \u201cMyUser\u201d type below.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>{  <\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;id&quot;<\/span>: <span style=\"color: #006080\">&quot;1234567&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;link&quot;<\/span>: <span style=\"color: #006080\">https:\/\/www.facebook.com\/sample<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>Note that the property derialization is case insensitive.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Id { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Link { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h3>Defining Connections<\/h3>\n<p>As noted previously, now you can include <em>connections<\/em> (Picture, Friends, Likes, etc) as properties using FacebookConnection&lt;T&gt; and FacebookGroupConnection&lt;T&gt;. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/1325.image_thumb_4FE3A9B2.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/1325.image_thumb_4FE3A9B2.png\" width=\"454\" height=\"122\" \/><\/a><\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyAppUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Email { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookConnection&lt;FacebookPicture&gt; Picture { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookGroupConnection&lt;MyAppUserFriend&gt; Friends { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> FacebookPicture<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Url { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyAppUserFriend<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Name { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Link { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookConnection&lt;FacebookPicture&gt; Picture { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>These types will match exactly how Facebook returns the <em>connection<\/em> data in JSON.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;name&quot;<\/span>: <span style=\"color: #006080\">&quot;sample name&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;email&quot;<\/span>: <span style=\"color: #006080\">&quot;sample@sample.com&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;id&quot;<\/span>: <span style=\"color: #006080\">&quot;1234567&quot;<\/span>,<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;picture&quot;<\/span>: {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #006080\">&quot;data&quot;<\/span>: {...}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    },<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #006080\">&quot;friends&quot;<\/span>: {    <\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #006080\">&quot;data&quot;<\/span>: [      <\/pre>\n<p><!--CRLF--><\/p>\n<pre>            {...},<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            {...},<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            {...}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        ]<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h3>Property Attributes<\/h3>\n<p>Since we use Json.NET to do the deserialization, you can use JsonProperty\/JsonIgnore to rename\/exclude a property.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyAppUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    [JsonIgnore] <span style=\"color: #008000\">\/\/ This ignores the property<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> MyProperty { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    [JsonProperty(<span style=\"color: #006080\">&quot;picture&quot;<\/span>)] <span style=\"color: #008000\">\/\/ This renames the property to picture.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookConnection&lt;FacebookPicture&gt; ProfilePicture { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>In addition you can apply modifiers to the <em>connections<\/em> using FacebookFieldModifier. For example, you can get the URL to a larger profile picture by adding the modifier \u201ctype(large)\u201d to Picture. Go to <a href=\"https:\/\/developers.facebook.com\/docs\/reference\/api#pictures\">Facebook Graph API<\/a> to see the modifiers that are available. When GetFacebookObjectAsync&lt;TFacebookObject&gt; makes the request, these modifiers will be added to the ?field query parameter.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> MyAppUser<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    [FacebookFieldModifier(<span style=\"color: #006080\">&quot;type(large)&quot;<\/span>)] <span style=\"color: #008000\">\/\/ This sets the picture size to large.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> FacebookConnection&lt;FacebookPicture&gt; Picture { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> FacebookPicture<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">string<\/span> Url { get; set; }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h2>Facebook Authorization<\/h2>\n<p>FacebookAuthorizeAttribute can be used just like before to ensure that the signed_request parameter (sent by Facebook) is valid before invoking an action. Additionally, you can require a set of permissions to be granted before reaching the action by passing them into the attribute. In case the authorization fails, either because of invalid signed request or missing permissions, the users will be redirected to a Facebook OAuth dialog asking them to login or grant the required permissions.<\/p>\n<p>Note that FacebookAuthorizeAttribute is not an authorization filter anymore, the actual authorization is done by FacebookAuthorizeFilter. That\u2019s why it\u2019s important to register the FacebookAuthorizeFilter globally to enable this functionality.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">static<\/span> <span style=\"color: #0000ff\">class<\/span> FacebookConfig<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">static<\/span> <span style=\"color: #0000ff\">void<\/span> Register(FacebookConfiguration configuration)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #008000\">\/\/ Other settings removed for clarity...<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #008000\">\/\/ Adding the authorization filter to check for Facebook signed requests and permissions<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>        GlobalFilters.Filters.Add(<span style=\"color: #0000ff\">new<\/span> FacebookAuthorizeFilter(configuration));<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>Having a global authorization filter allowed us to combine the permissions declared on both the controller and the action. Which means the user will see the OAuth dialog once instead twice for the \u201cProfile\u201d action below when the permissions are missing.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>[FacebookAuthorize(<span style=\"color: #006080\">&quot;email&quot;<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> UserController : Controller<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    [FacebookAuthorize(<span style=\"color: #006080\">&quot;user_photos&quot;<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> async Task&lt;ActionResult&gt; Profile(FacebookContext context) <\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #008000\">\/\/ Implementation removed for clarity<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/8270.image_thumb_3FAED663.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/8270.image_thumb_3FAED663.png\" width=\"504\" height=\"154\" \/><\/a><\/p>\n<h3>AuthorizationRedirectPath<\/h3>\n<p>When the permissions are missing, now you have the option of showing an \u201cinfo\u201d page before redirecting user to the OAuth dialog. In that page you can explaining why your app requires certain permissions so that users are more likely to grant them. To do that, add the following to your web.config and the user will be redirected to Home\/Permissions when the authorization fails due to missing permissions.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">appSettings<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AuthorizationRedirectPath&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;Home\/Permissions&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">appSettings<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>On the action that is receiving the redirect, you can use FacebookRedirectContext parameter to access information like the required permissions and the RedirectUrl to the Facebook OAuth dialog.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> HomeController : Controller<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #008000\">\/\/ Other actions removed for clarity...<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #008000\">\/\/ This action will handle the redirects from FacebookAuthorizeFilter when <\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #008000\">\/\/ the app doesn't have all the required permissions specified in the FacebookAuthorizeAttribute.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #008000\">\/\/ The path to this action is defined under appSettings (in Web.config) with the key 'Facebook:AuthorizationRedirectPath'.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> ActionResult Permissions(FacebookRedirectContext context)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #0000ff\">if<\/span> (ModelState.IsValid)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            <span style=\"color: #0000ff\">return<\/span> View(context);<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #0000ff\">return<\/span> View(<span style=\"color: #006080\">&quot;Error&quot;<\/span>);<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre>@using Microsoft.AspNet.Mvc.Facebook<\/pre>\n<p><!--CRLF--><\/p>\n<pre>@model FacebookRedirectContext<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>@if (Model.RequiredPermissions.Length <span style=\"color: #0000ff\">&gt;<\/span> 0)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">h3<\/span><span style=\"color: #0000ff\">&gt;<\/span>You need to grant the following permission(s) on Facebook to view this page:<span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">h3<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">ul<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>        @foreach (var permission in Model.RequiredPermissions)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">li<\/span><span style=\"color: #0000ff\">&gt;<\/span>@permission<span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">li<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>        }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">ul<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">a<\/span> <span style=\"color: #ff0000\">class<\/span><span style=\"color: #0000ff\">=&quot;buttonLink&quot;<\/span> <span style=\"color: #ff0000\">href<\/span><span style=\"color: #0000ff\">=&quot;@Html.Raw(Model.RedirectUrl)&quot;<\/span> <span style=\"color: #ff0000\">target<\/span><span style=\"color: #0000ff\">=&quot;_top&quot;<\/span><span style=\"color: #0000ff\">&gt;<\/span>Authorize this application<span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">a<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h2>Facebook Realtime Update Support<\/h2>\n<p>Out of the box, we provide you with an abstract FacebookRealtimeUpdateController, which is a <a href=\"http:\/\/www.asp.net\/web-api\">Web API controller<\/a> that will handle all the HTTP requests sent by <a href=\"https:\/\/developers.facebook.com\/docs\/reference\/api\/realtime\/\">Facebook Realtime Update<\/a> service. It will take care of verifying the subscription and validating the integrity of the payload by checking the X-Hub-Signature HTTP header. All you need to provide is a <a href=\"https:\/\/developers.facebook.com\/docs\/reference\/api\/realtime\/\">verify token<\/a> and your business logic to handle the update. Here is a sample implementation of FacebookRealtimeUpdateController.<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> UserRealtimeUpdateController : FacebookRealtimeUpdateController<\/pre>\n<p><!--CRLF--><\/p>\n<pre>{<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">private<\/span> <span style=\"color: #0000ff\">readonly<\/span> <span style=\"color: #0000ff\">static<\/span> <span style=\"color: #0000ff\">string<\/span> UserVerifyToken = ConfigurationManager.AppSettings[<span style=\"color: #006080\">&quot;Facebook:VerifyToken:User&quot;<\/span>];<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">override<\/span> <span style=\"color: #0000ff\">string<\/span> VerifyToken<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        get<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            <span style=\"color: #0000ff\">return<\/span> UserVerifyToken;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>&#160;<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">override<\/span> Task HandleUpdateAsync(ChangeNotification notification)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        <span style=\"color: #0000ff\">if<\/span> (notification.Object == <span style=\"color: #006080\">&quot;user&quot;<\/span>)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            <span style=\"color: #0000ff\">foreach<\/span> (var entry <span style=\"color: #0000ff\">in<\/span> notification.Entry)<\/pre>\n<p><!--CRLF--><\/p>\n<pre>            {<\/pre>\n<p><!--CRLF--><\/p>\n<pre>                <span style=\"color: #008000\">\/\/ Your logic to handle the update here<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>            }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>        }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>    }<\/pre>\n<p><!--CRLF--><\/p>\n<pre>}<\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<p>Note that you can have multiple custom FacebookRealtimeUpdateController to handle different <a href=\"https:\/\/developers.facebook.com\/docs\/reference\/api\/realtime\/\">subscriptions<\/a> (Users, Permissions, etc) with different verify tokens.<\/p>\n<h2>FacebookConfiguration<\/h2>\n<p>The static FacebookSettings class has been replaced by FacebookConfiguration. Notice that many components such as FacebookAuthorizeFilter are taking an instance of FacebookConfiguration in the constructor which makes unit testing easier. For global access to FacebookConfiguration within the application, you can use GlobalFacebookConfiguration.Configuration, which is a singleton instance.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/3580.image_thumb_739CD14C.png\"><img decoding=\"async\" style=\"border-right-width: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px;padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2012\/12\/3580.image_thumb_739CD14C.png\" width=\"354\" height=\"435\" \/><\/a><\/p>\n<h3>LoadFromAppSettings<\/h3>\n<p>This method loads the following properties from appSettings.<\/p>\n<ul>\n<li>AppId \u2013 this property is required. <\/li>\n<li>AppSecret \u2013 this property is required. <\/li>\n<li>AppNamespace \u2013 this property is required if you provided a namespace to the app you created on <a title=\"https:\/\/developers.facebook.com\/apps\" href=\"https:\/\/developers.facebook.com\/apps\">https:\/\/developers.facebook.com\/apps<\/a>. <\/li>\n<li>AppUrl \u2013 this property is optional. By default it\u2019s set to https:\/\/apps.facebook.com\/{AppId} or https:\/\/apps.facebook.com\/{AppNamespace} when the AppNamespace is set. The only time you might want to set this is if Facebook changes their app URL structure. <\/li>\n<li>AuthorizationRedirectPath \u2013 this property is optional. See the AuthorizationRedirectPath section above for more information. <\/li>\n<\/ul>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\">\n<pre><span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">appSettings<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AppId&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AppSecret&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AppNamespace&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AppUrl&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">key<\/span><span style=\"color: #0000ff\">=&quot;Facebook:AuthorizationRedirectPath&quot;<\/span> <span style=\"color: #ff0000\">value<\/span><span style=\"color: #0000ff\">=&quot;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre><span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">appSettings<\/span><span style=\"color: #0000ff\">&gt;<\/span><\/pre>\n<p><!--CRLF--><\/div>\n<\/div>\n<h3>ClientProvider property<\/h3>\n<p>You can set this property to customize how the FacebookClient is created. GlobalFacebookConfiguration.Configuration uses an instance of DefaultFacebookClientProvider which creates clients that use Json.NET serializers. <\/p>\n<h3>PermissionService property<\/h3>\n<p>You can set this property to change how current user permissions are retrieved. GlobalFacebookConfiguration.Configuration uses an instance of DefaultFacebookPermissionService which calls into Facebook Graph API to retrieve the current user permissions.<\/p>\n<p>&#160;<\/p>\n<p>Well, that concludes our overview of the new APIs in the Facebook Application library. I would encourage you to install the <a href=\"http:\/\/www.asp.net\/vnext\/overview\/fall-2012-update\"><strong>ASP.NET and Web Tools 2012.2<\/strong><\/a> and start playing with the Facebook Application template. Please do send us your feedback and feel free to use our <a href=\"http:\/\/aspnetwebstack.codeplex.com\/workitem\/list\/basic\"><strong>CodePlex site<\/strong><\/a> to report any issues you might find.<\/p>\n<p>Have fun building Facebook Apps with ASP.NET MVC!<\/p>\n<p>Yao<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019re looking to build a Facebook App using ASP.NET MVC, then you\u2019re in the right place. With the release of ASP.NET and Web Tools 2012.2, we\u2019ve added lots of updates to our Facebook Application template and library since we first introduced it in the Preview. The library, Microsoft.AspNet.Mvc.Facebook, can be downloaded as an independent [&hellip;]<\/p>\n","protected":false},"author":453,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[7333,7414,7412],"class_list":["post-1974","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-asp-net-mvc","tag-facebook-application","tag-visual-studio-2012"],"acf":[],"blog_post_summary":"<p>If you\u2019re looking to build a Facebook App using ASP.NET MVC, then you\u2019re in the right place. With the release of ASP.NET and Web Tools 2012.2, we\u2019ve added lots of updates to our Facebook Application template and library since we first introduced it in the Preview. The library, Microsoft.AspNet.Mvc.Facebook, can be downloaded as an independent [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/453"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=1974"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/1974\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=1974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=1974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=1974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}