-
-
Save mythz/4626283b302cf1b7f87685aea8b8a2ee to your computer and use it in GitHub Desktop.
OrmLite runtime attributes
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); | |
var dbc = dbFactory.DialectProvider.GetStringConverter(); | |
dbc.UseUnicode = true; | |
typeof(ServiceStack.Configuration.ConfigSetting) | |
.GetProperty("Id") | |
.AddAttributes(new ServiceStack.DataAnnotations.StringLengthAttribute(256)); | |
using (var db = dbFactory.OpenDbConnection()) | |
{ | |
db.CreateTable<ServiceStack.Configuration.ConfigSetting>(); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="System.Memory" version="4.5.3" targetFramework="net45" /> | |
<package id="ServiceStack.Text" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.Interfaces" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.Common" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.OrmLite" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.OrmLite.Sqlite.Windows" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.Redis" version="5.8.0" targetFramework="net45" /> | |
<package id="ServiceStack.Server" version="5.8.0" targetFramework="net45" /> | |
</packages> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment