View main.cs
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 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(); |
View main.cs
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 ServiceStack; | |
using ServiceStack.Text; | |
using ServiceStack.OrmLite; | |
using ServiceStack.OrmLite.Sqlite; | |
using ServiceStack.DataAnnotations; | |
OrmLiteUtils.PrintSql(); | |
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider); |
View main.cs
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 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; |
View main.cs
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
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}"); |
View data.cs
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.Data; | |
using ServiceStack; | |
using ServiceStack.OrmLite; | |
using ServiceStack.DataAnnotations; | |
public class Artist | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } |
View Afile.cs
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
// Afile.cs | |
// Created by mythz on 2016/07/25 | |
class File { | |
} |
View data.cs
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 ServiceStack.DataAnnotations; | |
public class Artist | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
[Reference] | |
public List<Track> Tracks { get; set; } |
View fizzbuzz.bat
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
REM courtesy of https://github.com/nixha | |
@echo off | |
for /L %%I IN (1, 1, 100) DO ( | |
call :OUTPUT %%I | |
) | |
pause | |
exit |
View Cat.cs
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; | |
public class File { | |
public string Name { get; set; } | |
public string Read() { | |
return System.IO.File.ReadAllText(Name); | |
} | |
} | |
class Program { |