Skip to content

Instantly share code, notes, and snippets.

Demis Bellot mythz

Block or report user

Report or block mythz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mythz
mythz / main.cs
Last active Oct 18, 2018
test json deserialization
View main.cs
using System;
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
var json = "{\"Confirmations\":[{\"ChangeId\":126552616,\"Confirmed\":true}]}";
[Route("/confirmations", "PUT")]
public class PutConfirmed : IReturn<PutConfirmedResponse>
@mythz
mythz / StringSegment.cs
Last active Jul 1, 2018
Removed StringSegmentExtensions.cs
View StringSegment.cs
#if !NETSTANDARD2_0
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace ServiceStack.Text
@mythz
mythz / main.cs
Created Jun 4, 2018
SelectMulti example
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
public class Customer
@mythz
mythz / main.cs
Last active Apr 5, 2018
Encode en-dash char test
View main.cs
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
class Dto
{
public string Text { get; set; }
}
var dto = new Dto { Text = "The – (en dash) character" };
@mythz
mythz / main.cs
Created Jan 23, 2018
OrmLite Dynamic Attribute Test
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
using ServiceStack.Logging;
LogManager.LogFactory = new ConsoleLogFactory(debugEnabled:true);
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
@mythz
mythz / main.cs
Last active Dec 17, 2017
OrmLite 1:1 Users and Roles
View main.cs
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
using ServiceStack.Model;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
@mythz
mythz / main.cs
Created Dec 10, 2017
JsonObject null response
View main.cs
using System.Linq;
using ServiceStack;
using ServiceStack.Text;
public class CloudflareResponse
{
public JsonObject result { get; set; }
}
var json = "{\"result\":null}";
@mythz
mythz / main.cs
Created Dec 8, 2017
Templates List Dictionary Example
View main.cs
using System.Linq;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.Templates;
var __Contacts = new List<Dictionary<string,object>> {
new Dictionary<string,object> {
{ "Title", "foo" },
},
@mythz
mythz / data.cs
Last active Oct 31, 2017
OrmLite Multiple Order By
View data.cs
using System.Collections.Generic;
using System.Data;
using ServiceStack;
using ServiceStack.OrmLite;
using ServiceStack.DataAnnotations;
public class Artist
{
public int Id { get; set; }
public string Name { get; set; }
@mythz
mythz / main.cs
Last active Oct 25, 2017
Test RedisAuthRepository
View main.cs
using System;
using ServiceStack;
using ServiceStack.Auth;
using ServiceStack.Text;
using ServiceStack.Redis;
using ServiceStack.Testing;
using ServiceStack.DataAnnotations;
IUserAuth fromRedis;
var redisManager = new RedisManagerPool("localhost:6379");
You can’t perform that action at this time.