This file contains hidden or 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 ServiceStack; | |
using ServiceStack.Text; | |
using ServiceStack.Redis; | |
using ServiceStack.DataAnnotations; | |
using ServiceStack.Caching; | |
var redisManager = new RedisManagerPool("localhost:6379"); | |
var redis = redisManager.GetClient(); | |
redis.FlushAll(); |
This file contains hidden or 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 ServiceStack; | |
using ServiceStack.Text; | |
using ServiceStack.OrmLite; | |
using ServiceStack.OrmLite.Sqlite; | |
using ServiceStack.DataAnnotations; | |
OrmLiteUtils.PrintSql(); | |
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider); |
This file contains hidden or 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 ServiceStack; | |
using ServiceStack.Text; | |
using System.Collections.Generic; | |
AutoMapping.RegisterConverter((CarRevisionDbo from) => { | |
var to = from.ConvertTo<CarRevisionDto>(skipConverters:true); | |
to.PopulateWith(from.Car); | |
return to; |
This file contains hidden or 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 n = "1"; | |
object value; | |
var hasDecimal = n.IndexOf('.') >= 0; | |
value = hasDecimal | |
? double.Parse(n) | |
: int.Parse(n); | |
System.Console.WriteLine($"{value} is {value.GetType().Name}"); |
This file contains hidden or 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.Data; | |
using ServiceStack; | |
using ServiceStack.OrmLite; | |
using ServiceStack.DataAnnotations; | |
public class Artist | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } |
This file contains hidden or 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
// Afile.cs | |
// Created by mythz on 2016/07/25 | |
class File { | |
} |
This file contains hidden or 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 ServiceStack.DataAnnotations; | |
public class Artist | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
[Reference] | |
public List<Track> Tracks { get; set; } |
This file contains hidden or 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
REM courtesy of https://github.com/nixha | |
@echo off | |
for /L %%I IN (1, 1, 100) DO ( | |
call :OUTPUT %%I | |
) | |
pause | |
exit |
This file contains hidden or 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; | |
public class File { | |
public string Name { get; set; } | |
public string Read() { | |
return System.IO.File.ReadAllText(Name); | |
} | |
} | |
class Program { |