Skip to content

Instantly share code, notes, and snippets.

View Msirkovsky's full-sized avatar

Marek Sirkovský Msirkovsky

View GitHub Profile
public ActionResult Receive()
{
var query = Request.QueryString;
_logWriter.WriteLine(Request.RawUrl);
if (query["hub.mode"] == "subscribe" &&
query["hub.verify_token"] == "myToken874523")
{
//string type = Request.QueryString["type"];
private string PostRaw(string url, string data)
{
var request = (HttpWebRequest)WebRequest.Create(url);
request.ContentType = "application/json";
request.Method = "POST";
using (var requestWriter = new StreamWriter(request.GetRequestStream()))
{
requestWriter.Write(data);
}
public class BotRequest
{
public string @object { get; set; }
public List<BotEntry> entry { get; set; }
}
public class BotEntry
{
public string id { get; set; }
public long time { get; set; }
public ActionResult Receive()
{
var query = Request.QueryString;
_logWriter.WriteLine(Request.RawUrl);
if (query["hub.mode"] == "subscribe" &&
query["hub.verify_token"] == "myToken874523")
{
//string type = Request.QueryString["type"];
Task.Factory.StartNew(() =>
{
processing messages .......
});
return new HttpStatusCodeResult(HttpStatusCode.OK);
public class DataSalesForExcelController : EntitySetController<DataSalesForExcel, int>
{
public override IQueryable<DataSalesForExcel> Get()
{
}
}
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
  name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
  defaults: new { id = RouteParameter.Optional }
  );
<service>
<workspace>
<atom:title type="text">Default</atom:title>
<collection href="DataSalesForExcel">
<atom:title type="text">DataSalesForExcel</atom:title>
</collection>
</workspace>
</service>
var dict = Request.GetQueryNameValuePairs().ToDictionary(kv => kv.Key, kv => kv.Value, StringComparer.OrdinalIgnoreCase);
var val = dict["saleDate"];
let GetValue=(rangeName) => 
let
  CellRange = Excel.CurrentWorkbook(){[Name=rangeName]}[Content],
  Value = CellRange{0}[Column1]
  in
  Value
in
let
SalesDate = GetValue("salesDateCell"),