This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using Facebook; | |
using MyFacebookSite3434.Models; | |
using System.Web.Security; | |
namespace MyFacebookSite3434.Controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fb = new FacebookClient("access_token"); | |
var result = fb.Get<FBUser1>("/me"); | |
string name = result.Name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Export] | |
[PartCreationPolicy(CreationPolicy.NonShared)] | |
public class MyFirstJob : IJob | |
{ | |
[Import] | |
public IMyFirstService MyFirstService { get; set; } | |
public void Run() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web.Mvc; | |
using System.Collections.Generic; | |
using System.Configuration; | |
public static class StaticContentHelpers | |
{ | |
private const string azureCdnUrl = ".cloudapp.net/cdn"; | |
private const string aspCdnUrl = "ajax.aspnetcdn.com/ajax"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem This is only for SDK 1.4 and not a best practice to detect DevFabric. | |
if ("%WA_CONTAINER_SID%") == ("") goto Exit | |
echo Installing Web-Mgmt-Service | |
if exist "%windir%\system32\ServerManagerCmd.exe" "%windir%\system32\ServerManagerCmd.exe" -install Web-Mgmt-Service | |
echo Configuring Web-Mgmt-Service | |
sc config wmsvc start= auto | |
net stop wmsvc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web.Script.Serialization; | |
namespace Facebook { | |
public class FrameworkJsonSerializer : IJsonSerializer { | |
public string SerializeObject(object obj) { | |
var serializer = new JavaScriptSerializer(); | |
return serializer.Serialize(obj); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool TryDeserializeObject(string json, out object @object) | |
{ | |
bool success = true; | |
if (json != null) | |
{ | |
char[] charArray = json.ToCharArray(); | |
int index = 0; | |
@object = ParseValue(charArray, ref index, ref success); | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FormatterConfig | |
{ | |
public static void ConfigureApi(HttpConfiguration config) | |
{ | |
// Remove the XML formatter | |
config.Formatters.Remove(config.Formatters.XmlFormatter); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person { | |
public int Id { get; set; } | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public virtual ICollection<Message> Messages { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socket = io.connect(); | |
socket.on('connect', function () { | |
socket.emit('connect', userInfo); | |
}); | |
$('#text').keypress(function (e) { | |
if (e.keyCode == 13) { | |
$("#send").click(); | |
return false; |