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
//Open database context | |
using(DbContext db = new DbContext()) | |
{ | |
//Get the id of the entity we want to update | |
int id = 1; | |
//Create an instance of the entity we want to update | |
SomeEntity entity = new SomeEntity(){ | |
Id = id, |
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
//Open database context | |
using(DbContext db = new DbContext()) | |
{ | |
//Get the id of the entity we want to update | |
int id = 1; | |
//Create an instance of the entity we want to update | |
SomeEntity entity = new SomeEntity(){ | |
Id = id, |
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
//Open database context | |
using(DbContext db = new DbContext()) | |
{ | |
//Get the id of the entity we want to update | |
int id = 1; | |
//Create an instance of the entity we want to update | |
SomeEntity entity = new SomeEntity(){ | |
Id = id, |
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.Linq; | |
using DDay.iCal; | |
using Newtonsoft.Json; | |
public class YourClass | |
{ | |
public string YourMethod() | |
{ | |
//Download the .ics file using DDay.iCal package from nuget (install-package dday.ical) |
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.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; |
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 async Task<string> YourMethod() | |
{ | |
//Create a list of your parameters | |
var postParams = new List<KeyValuePair<string, object>>(){ | |
new KeyValuePair<string, object>("FirstParameter", "First Value") , | |
new KeyValuePair<string, object>("SecondParameter", "Second Value") | |
}; | |
//Join KVPs into a x-www-formurlencoded string | |
var formString = string.Join("&", postParams.Select(x => string.Format("{0}={1}", x.Key, x.Value))); |
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.IO; | |
using System.Threading.Tasks; | |
using Windows.UI.Xaml; | |
using Windows.UI.Xaml.Controls; | |
using Windows.UI.Xaml.Media.Imaging; | |
using Windows.UI.Xaml.Navigation; | |
using Windows.Web.Http; | |
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556 |
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
<!-- A WinRT XAML page --> | |
<Page | |
x:Class="MyApp.MyPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:MyApp" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" |
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
jQuery.postJSON = function (url, data, success, dataType) { | |
if (dataType === void 0) { dataType = "json"; } | |
if (typeof (data) === "object") { data = JSON.stringify(data);} | |
var ajax = { | |
url: url, | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
dataType: dataType, | |
data: data, | |
success: success |
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
jQuery.postJSON = function (url, data, success, antiForgeryToken, dataType) { | |
if (dataType === void 0) { dataType = "json"; } | |
if (typeof (data) === "object") { data = JSON.stringify(data);} | |
var ajax = { | |
url: url, | |
type: "POST", | |
contentType: "application/json; charset=utf-8", | |
dataType: dataType, | |
data: data, | |
success: success |
OlderNewer