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 Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
var config = new HttpConfiguration(); | |
var jsonSerializerSettings = config.Formatters.JsonFormatter.SerializerSettings; | |
//Remove unix epoch date handling, in favor of ISO | |
jsonSerializerSettings.Converters.Add(new IsoDateTimeConverter { DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fff" }); |
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 Ninject; | |
using Ninject.Modules; | |
using Ninject.Web.Common; | |
using Raven.Client; | |
using Raven.Client.Embedded; | |
using Raven.Database.Server; | |
namespace RavenDBInFiveMinutes | |
{ | |
public class RavenDBNinjectModule : NinjectModule |
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
// Method /createMessage https://www.pushwoosh.com/programming-push-notification/pushwoosh-push-notification-remote-api/#PushserviceAPI-Method-messages-create | |
dynamic pushwoosh = new RestClient("https://cp.pushwoosh.com/json/1.3"); | |
var pushWooshResponse = await pushwoosh.CreateMessage.Post(new | |
{ | |
request = new | |
{ | |
application = "APPLICATION_CODE", | |
auth = "API_ACCESS_TOKEN", | |
notifications = new[] { new { | |
send_date = "now", // YYYY-MM-DD HH:mm OR 'now' |
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
dynamic client = new RestClient("http://jsonplaceholder.typicode.com"); | |
var post = await client.Posts(1).Get(); | |
Assert.That(post.HttpResponseMessage.StatusCode, Is.EqualTo(HttpStatusCode.OK)); | |
Assert.That(post.id, Is.EqualTo(1)); |
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
h1 { | |
font-size: 3rem; | |
color:red; | |
} |
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.Collections.Generic; | |
using System.Web; | |
using Mindscape.Raygun4Net.Messages; | |
namespace Logging.Extensions | |
{ | |
public static class Raygun4NetExtensions | |
{ | |
public static void SetNonSensitiveHttpDetails(this RaygunMessage message) | |
{ |
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
<appSettings> | |
<add key="MyAppConfig" value=" | |
{ | |
'Website': 'http://dalsoft.co.uk/', | |
'DatabaseConnectionString': 'Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;' | |
}" /> | |
</appSettings> |
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 MyAppConfig : JsonConfig<MyAppConfig> | |
{ | |
public string Website { get; set; } | |
public string DatabaseConnectionString { get; set; } | |
} |
NewerOlder