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 copyAttribute = function (attr, source, target, altAttr) { | |
if (!!altAttr && !!source.data(altAttr)) { | |
target.data(attr, source.data(altAttr)); | |
} | |
else { | |
target.data(attr, source.data(attr)); | |
} | |
}; | |
var setSnipAttributes = function (item) { |
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 Newtonsoft.Json.Linq; | |
using RestSharp; | |
using RestSharp.Authenticators; | |
/* | |
You will need to install these two NuGet packages: | |
Install-Package RestSharp | |
Install-Package Newtonsoft.Json |
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 OrdersController : ApiController | |
{ | |
// RouteName parameter is mandatory to generate URLs. | |
[GET("api/orders/{orderId}/items", RouteName = "GetOrderItems")] | |
public HttpResponseMessage GetOrderItems(int orderId) | |
{ | |
var myUrl = Url.Link("GetOrderItems", new { orderId = orderId }); | |
return Request.CreateResponse(HttpStatusCode.OK); | |
} |
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 abstract class Entity | |
{ | |
public int Id {get;set;} | |
} | |
public class EntityFrameworkSession : ISession | |
{ | |
private readonly DbContext context; | |
public EntityFrameworkSession(DbContext context) |