Skip to content

The App for testing opinionated ServiceStack Framework with REST API.

Notifications You must be signed in to change notification settings

qualtrak/servicestack-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServiceStack App

.NET - Mono switching

When in Mono - Monodevelop (Tested on Mac OS X Mountain Lion)

  • In WebApp.Bootstrap.AppHost uncomment Sqlite and comment SQL Server:
IDbConnectionFactory dbFactory = new OrmLiteConnectionFactory(":memory:", false, SqliteOrmLiteDialectProvider.Instance);
this.CreateSqliteInMemoryTables(dbFactory);

// string connectionString = ConfigurationManager.ConnectionStrings["QcoachServiceStack"].ConnectionString;
// IDbConnectionFactory dbFactory = new OrmLiteConnectionFactory(connectionString, false, SqlServerOrmLiteDialectProvider.Instance);

When in .NET - Visual Studio

  • In WebApp.Bootstrap.AppHost uncomment SQL Server and comment Sqlite:
// IDbConnectionFactory dbFactory = new OrmLiteConnectionFactory(":memory:", false, SqliteOrmLiteDialectProvider.Instance);
// this.CreateSqliteInMemoryTables(dbFactory);

string connectionString = ConfigurationManager.ConnectionStrings["ServiceStackTest"].ConnectionString;
IDbConnectionFactory dbFactory = new OrmLiteConnectionFactory(connectionString, false, SqlServerOrmLiteDialectProvider.Instance);

Creating SQL Server Express Db Tables for first time

Connection string in web.config:

<connectionStrings>
<add name="ServiceStackTest" providerName="System.Data.SqlClient" connectionString="Data Source=.\sqlexpress;Initial Catalog=test-servicestack;Integrated Security=true;MultipleActiveResultSets=True" />
</connectionStrings>

Create Database

  • Go to SSMS and add new Database named test-servicestack.

Create Tables

  • Add CreateSqliteInMemoryTables below the dbFactory of SQL Server.
  • After first run make sure this line of code is commented, because it will always DROP Table and recreate it.
string connectionString = ConfigurationManager.ConnectionStrings["ServiceStackTest"].ConnectionString;
IDbConnectionFactory dbFactory = new OrmLiteConnectionFactory(connectionString, false, SqlServerOrmLiteDialectProvider.Instance);

this.CreateSqliteInMemoryTables(dbFactory);

About

The App for testing opinionated ServiceStack Framework with REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published