Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/ServiceStack/ServiceStack…

  • Loading branch information...
commit 6b80ea54bd0767ae40d5c0364aa3b0c8bb0244d1 2 parents 56104b7 + e75a1ae
@mythz mythz authored
View
13 README.md
@@ -344,6 +344,11 @@ db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName);
```
**UPDATE "Person" SET "FirstName" = 'JJ'**
+```csharp
+db.UpdateOnly(new Person { FirstName = "JJ", Age = 12 }, p => new { p.FirstName, p.Age });
+```
+**UPDATE "Person" SET "FirstName" = 'JJ', "Age" = 12**
+
When present, the second expression is used as the where filter:
```csharp
db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName, p => p.LastName == "Hendrix");
@@ -946,4 +951,10 @@ As [performance is the most important feature](https://github.com/mythz/ScalingD
- Fast, supports dynamics and expandos, smart use of optional params to provide a wrist-friendly api, fits in a single class. Multiple RDBMS support. Requires .NET 4.
* **[Simple.Data](https://github.com/markrendle/Simple.Data)** - by [@markrendle](http://twitter.com/markrendle)
- A little slower than above ORMS, most wrist-friendly courtesy of a dynamic API, multiple RDBMS support inc. Mongo DB. Requires .NET 4.
-
+
+
+# Community Resources
+
+ - [Simple ServiceStack OrmLite Example](http://www.curlette.com/?p=1068) by [@robrtc](https://twitter.com/robrtc)
+ - [OrmLite Blobbing done with NHibernate and Serialized JSON](http://www.philliphaydon.com/2012/03/ormlite-blobbing-done-with-nhibernate-and-serialized-json/) by [@philliphaydon](https://twitter.com/philliphaydon)
+ - [Creating An ASP.NET MVC Blog With ServiceStack.OrmLite](http://www.eggheadcafe.com/tutorials/asp-net/285cbe96-9922-406a-b193-3a0b40e31c40/creating-an-aspnet-mvc-blog-with-servicestackormlite.aspx) by [@peterbromberg](https://twitter.com/peterbromberg)
View
71 src/ServiceStack.OrmLite.DDLTest/ServiceStack.OrmLite.DDLTest.csproj
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>12.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E106F587-2DFF-4550-BA49-9A81A2EC344F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>ServiceStack.OrmLite.DDLTest</RootNamespace>
+ <AssemblyName>ServiceStack.OrmLite.DDLTest</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="nunit.framework">
+ <HintPath>..\..\lib\tests\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="FirebirdSql.Data.FirebirdClient">
+ <HintPath>..\..\lib\FirebirdSql.Data.FirebirdClient.dll</HintPath>
+ </Reference>
+ <Reference Include="MySql.Data">
+ <HintPath>..\..\lib\MySql.Data.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Common">
+ <HintPath>..\..\lib\ServiceStack.Common.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Interfaces">
+ <HintPath>..\..\lib\ServiceStack.Interfaces.dll</HintPath>
+ </Reference>
+ <Reference Include="ServiceStack.Text">
+ <HintPath>..\..\lib\ServiceStack.Text.dll</HintPath>
+ </Reference>
+ <Reference Include="System.ComponentModel.DataAnnotations" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Test.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <ProjectReference Include="..\ServiceStack.OrmLite\ServiceStack.OrmLite.csproj">
+ <Project>{96179AC6-F6F1-40C3-9FDD-4F6582F54C5C}</Project>
+ <Name>ServiceStack.OrmLite</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ServiceStack.OrmLite.Firebird\ServiceStack.OrmLite.Firebird.csproj">
+ <Project>{317B64BA-D7A6-4A15-8719-821B38147C63}</Project>
+ <Name>ServiceStack.OrmLite.Firebird</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\ServiceStack.OrmLite.MySql\ServiceStack.OrmLite.MySql.csproj">
+ <Project>{FD20F088-ACC0-4979-AC0C-8C541C2E7DE5}</Project>
+ <Name>ServiceStack.OrmLite.MySql</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project>
View
164 src/ServiceStack.OrmLite.DDLTest/Test.cs
@@ -0,0 +1,164 @@
+using System;
+using NUnit.Framework;
+using ServiceStack.OrmLite;
+using ServiceStack.OrmLite.Firebird;
+using ServiceStack.OrmLite.MySql;
+using System.Collections.Generic;
+using ServiceStack.Logging;
+using ServiceStack.Logging.Support.Logging;
+using System.ComponentModel.DataAnnotations;
+
+namespace ServiceStack.OrmLite.DDLTest
+{
+
+
+ [TestFixture()]
+ public class Test
+ {
+ List<Dialect> dialects = new List<Dialect>();
+
+ [TestFixtureSetUp]
+ public void TestFixtureSetup()
+ {
+ dialects.Add ( new Dialect{
+ Provider= FirebirdOrmLiteDialectProvider.Instance,
+ AddColumnString="ALTER TABLE Model ADD Column1 VARCHAR(128) ;",
+ AlterColumnString="ALTER TABLE Model ALTER Column2 VARCHAR(50) ;",
+ ChangeColumnNameString="ALTER TABLE Model ALTER OldColumn3 TO Column3 ;",
+ AddFKString="ALTER TABLE Child ADD CONSTRAINT JustOneFK FOREIGN KEY (IdModel) REFERENCES Model (Id) ON DELETE CASCADE ON UPDATE NO ACTION;",
+ AddFKRestrictString="ALTER TABLE Child ADD CONSTRAINT JustOneMoreFK FOREIGN KEY (IdModel) REFERENCES Model (Id) ON UPDATE NO ACTION;",
+ CreateIndexString="CREATE UNIQUE INDEX JustIndexOnColumn3 ON Model(Column3);"
+
+ });
+ dialects.Add ( new Dialect{
+ Provider= MySqlDialectProvider.Instance,
+ AddColumnString="ALTER TABLE `Model` ADD COLUMN `Column1` VARCHAR(255) NULL;",
+ AlterColumnString="ALTER TABLE `Model` MODIFY COLUMN `Column2` VARCHAR(50) NULL;",
+ ChangeColumnNameString="ALTER TABLE `Model` CHANGE COLUMN `OldColumn3` `Column3` VARCHAR(255) NULL;",
+ AddFKString="ALTER TABLE `Child` ADD CONSTRAINT `JustOneFK` FOREIGN KEY (`IdModel`) REFERENCES `Model` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION;",
+ AddFKRestrictString="ALTER TABLE `Child` ADD CONSTRAINT `JustOneMoreFK` FOREIGN KEY (`IdModel`) REFERENCES `Model` (`Id`) ON DELETE RESTRICT ON UPDATE NO ACTION;",
+ CreateIndexString="CREATE UNIQUE INDEX `JustIndexOnColumn3` ON `Model`(`Column3`);"
+ });
+
+ LogManager.LogFactory = new ConsoleLogFactory();
+ }
+
+ [Test()]
+ public void CanAddColumn ()
+ {
+ var model = typeof(Model);
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ var fielDef = ModelDefinition<Model>.Definition.GetFieldDefinition<Model> (f => f.Column1);
+ Assert.AreEqual(d.AddColumnString, (d.Provider.ToAddColumnStatement(model, fielDef)));
+ }
+ }
+
+ [Test()]
+ public void CanAAlterColumn ()
+ {
+ var model = typeof(Model);
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ var fielDef = ModelDefinition<Model>.Definition.GetFieldDefinition<Model> (f => f.Column2);
+ Assert.AreEqual(d.AlterColumnString, (d.Provider.ToAlterColumnStatement(model, fielDef)));
+ }
+
+ }
+
+
+ [Test()]
+ public void CanChangeColumnName ()
+ {
+ var model = typeof(Model);
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ var fielDef = ModelDefinition<Model>.Definition.GetFieldDefinition<Model> (f => f.Column3);
+ Assert.AreEqual(d.ChangeColumnNameString,(d.Provider.ToChangeColumnNameStatement(model, fielDef,"OldColumn3")));
+
+ }
+
+ }
+
+ [Test()]
+ public void CanAddForeignKey ()
+ {
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ Assert.AreEqual(d.AddFKString,
+ d.Provider.ToAddForeignKeyStatement<Child,Model>(f=>f.IdModel,
+ fk=>fk.Id,OnFkOption.NoAction,OnFkOption.Cascade, "JustOneFK"));
+ }
+ }
+
+ [Test()]
+ public void CanAddForeignKeyRestrict ()
+ {
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ Assert.AreEqual(d.AddFKRestrictString,
+ d.Provider.ToAddForeignKeyStatement<Child,Model>(f=>f.IdModel,
+ fk=>fk.Id,OnFkOption.NoAction,OnFkOption.Restrict, "JustOneMoreFK"));
+ }
+ }
+
+
+ [Test()]
+ public void CanCreateIndex ()
+ {
+
+ foreach (var d in dialects)
+ {
+ OrmLiteConfig.DialectProvider=d.Provider;
+ Assert.AreEqual(d.CreateIndexString, d.Provider.ToCreateIndexStatement<Model>(f=>f.Column3, "JustIndexOnColumn3", true) );
+
+ }
+
+ }
+
+
+ }
+
+ public class Model
+ {
+ public Model()
+ {
+ }
+ public int Id { get; set; }
+ public string Column1{ get; set; }
+ [StringLength(50)]
+ public string Column2{ get; set; }
+ public string Column3{ get; set; }
+
+ }
+
+ public class Child
+ {
+ public Child(){}
+ public int Id{ get; set;}
+ public int IdModel{ get; set;}
+
+ }
+
+ public class Dialect
+ {
+ public IOrmLiteDialectProvider Provider { get; set; }
+ public string AddColumnString { get; set; }
+ public string AlterColumnString { get; set; }
+ public string ChangeColumnNameString { get; set; }
+ public string AddFKString { get; set; }
+ public string AddFKRestrictString { get; set; }
+ public string CreateIndexString { get; set; }
+
+ }
+}
View
81 src/ServiceStack.OrmLite.Firebird/FirebirdOrmLiteDialectProvider.cs
@@ -40,6 +40,7 @@ public FirebirdOrmLiteDialectProvider(bool compactGuid)
base.RealColumnDefinition= "FLOAT";
base.DefaultStringLength=128;
base.InitColumnTypeMap();
+ DefaultValueFormat = " DEFAULT '{0}'";
}
public override IDbConnection CreateConnection(string connectionString, Dictionary<string, string> options)
@@ -334,20 +335,15 @@ public override string ToCreateTableStatement(Type tableType)
if (fieldDef.ForeignKey == null) continue;
var refModelDef = GetModel(fieldDef.ForeignKey.ReferenceType);
-
- var modelName= modelDef.IsInSchema
- ? modelDef.Schema + "_" + NamingStrategy.GetTableName(modelDef.ModelName)
- : NamingStrategy.GetTableName(modelDef.ModelName);
-
- var refModelName= refModelDef.IsInSchema
- ? refModelDef.Schema + "_" + NamingStrategy.GetTableName(refModelDef.ModelName)
- : NamingStrategy.GetTableName(refModelDef.ModelName);
-
+
sbConstraints.AppendFormat(", \n\n CONSTRAINT {0} FOREIGN KEY ({1}) REFERENCES {2} ({3})",
GetQuotedName(fieldDef.ForeignKey.GetForeignKeyName(modelDef, refModelDef, NamingStrategy, fieldDef)),
GetQuotedColumnName(fieldDef.FieldName),
GetQuotedTableName(refModelDef),
GetQuotedColumnName(refModelDef.PrimaryKey.FieldName));
+
+ sbConstraints.Append(GetForeignKeyOnDeleteClause(fieldDef.ForeignKey));
+ sbConstraints.Append(GetForeignKeyOnUpdateClause(fieldDef.ForeignKey));
}
if (sbPk.Length !=0) sbColumns.AppendFormat(", \n PRIMARY KEY({0})", sbPk);
@@ -402,16 +398,16 @@ public override string ToCreateTableStatement(Type tableType)
var sql = new StringBuilder();
sql.AppendFormat("{0} {1}", GetQuotedColumnName(fieldName), fieldDefinition);
-
+
+ if (!string.IsNullOrEmpty(defaultValue))
+ {
+ sql.AppendFormat(DefaultValueFormat, defaultValue);
+ }
+
if (!isNullable)
{
sql.Append(" NOT NULL");
- }
-
- if (!string.IsNullOrEmpty(defaultValue))
- {
- sql.AppendFormat(DefaultValueFormat, defaultValue);
- }
+ }
return sql.ToString();
}
@@ -734,6 +730,59 @@ public override bool DoesTableExist(IDbCommand dbCmd, string tableName)
return result > 0;
}
+
+ public override string GetForeignKeyOnDeleteClause(ForeignKeyConstraint foreignKey)
+ {
+ return (!string.IsNullOrEmpty(foreignKey.OnDelete) && foreignKey.OnDelete.ToUpper()!="RESTRICT" )? " ON DELETE " + foreignKey.OnDelete : "";
+ }
+
+ public override string GetForeignKeyOnUpdateClause(ForeignKeyConstraint foreignKey)
+ {
+ return (!string.IsNullOrEmpty(foreignKey.OnUpdate) && foreignKey.OnUpdate.ToUpper()!="RESTRICT" )? " ON UPDATE " + foreignKey.OnUpdate : "";
+ }
+
+ #region DDL
+ public override string ToAddColumnStatement(Type modelType, FieldDefinition fieldDef){
+
+ var column = GetColumnDefinition(fieldDef.FieldName,
+ fieldDef.FieldType,
+ fieldDef.IsPrimaryKey,
+ fieldDef.AutoIncrement,
+ fieldDef.IsNullable,
+ fieldDef.FieldLength,
+ fieldDef.Scale,
+ fieldDef.DefaultValue);
+ return string.Format("ALTER TABLE {0} ADD {1} ;",
+ GetQuotedTableName(GetModel(modelType).ModelName),
+ column);
+ }
+
+ public override string ToAlterColumnStatement(Type modelType, FieldDefinition fieldDef)
+ {
+
+ var column = GetColumnDefinition(fieldDef.FieldName,
+ fieldDef.FieldType,
+ fieldDef.IsPrimaryKey,
+ fieldDef.AutoIncrement,
+ fieldDef.IsNullable,
+ fieldDef.FieldLength,
+ fieldDef.Scale,
+ fieldDef.DefaultValue);
+ return string.Format("ALTER TABLE {0} ALTER {1} ;",
+ GetQuotedTableName(GetModel(modelType).ModelName),
+ column);
+ }
+
+ public override string ToChangeColumnNameStatement(Type modelType,
+ FieldDefinition fieldDef,
+ string oldColumnName)
+ {
+ return string.Format("ALTER TABLE {0} ALTER {1} TO {2} ;",
+ GetQuotedTableName(GetModel(modelType).ModelName),
+ GetQuotedColumnName(oldColumnName),
+ GetQuotedColumnName(fieldDef.FieldName));
+ }
+ #endregion DDL
}
}
View
20 src/ServiceStack.OrmLite.SqlServer/SqlServerOrmLiteDialectProvider.cs
@@ -150,25 +150,9 @@ public void UseDatetime2(bool shouldUseDatetime2)
{
_useDateTime2 = shouldUseDatetime2;
DateTimeColumnDefinition = shouldUseDatetime2 ? "datetime2" : "datetime";
- InitColumnTypeMap();
+ base.DbTypeMap.Set<DateTime>(shouldUseDatetime2 ? DbType.DateTime2 : DbType.DateTime, DateTimeColumnDefinition);
+ base.DbTypeMap.Set<DateTime?>(shouldUseDatetime2 ? DbType.DateTime2 : DbType.DateTime, DateTimeColumnDefinition);
}
-
- protected override void AddParameterForFieldToCommand(IDbCommand command, FieldDefinition fieldDef, object objWithProperties)
- {
- //have to override, because DbTypeMap.Set<T> expects DbType, and SqlDbType is not a DbType...
- if(_useDateTime2 && (fieldDef.FieldType == typeof(DateTime) || fieldDef.FieldType == typeof(DateTime?))) {
- var sqlCmd = (SqlCommand)command;//should be SqlCommand...
- var p = sqlCmd.CreateParameter();
- p.ParameterName = string.Format("{0}{1}", ParamString, fieldDef.FieldName);
-
- p.SqlDbType = SqlDbType.DateTime2;
- p.Value = GetValueOrDbNull(fieldDef, objWithProperties);
-
- command.Parameters.Add(p);
- } else {
- base.AddParameterForFieldToCommand(command, fieldDef, objWithProperties);
- }
- }
public override long GetLastInsertId(IDbCommand dbCmd)
{
View
30 src/ServiceStack.OrmLite.sln
@@ -100,6 +100,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.OrmLite.Sqlite
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.OrmLite.Oracle.Tests", "ServiceStack.OrmLite.Oracle.Tests\ServiceStack.OrmLite.Oracle.Tests.csproj", "{DE5CA3EB-010D-492A-A0B7-501D7941FA51}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.OrmLite.DDLTest", "ServiceStack.OrmLite.DDLTest\ServiceStack.OrmLite.DDLTest.csproj", "{E106F587-2DFF-4550-BA49-9A81A2EC344F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1095,6 +1097,34 @@ Global
{DE5CA3EB-010D-492A-A0B7-501D7941FA51}.STATIC_ONLY NO_EXPRESSIONS|Mixed Platforms.ActiveCfg = Release|Any CPU
{DE5CA3EB-010D-492A-A0B7-501D7941FA51}.STATIC_ONLY NO_EXPRESSIONS|Mixed Platforms.Build.0 = Release|Any CPU
{DE5CA3EB-010D-492A-A0B7-501D7941FA51}.STATIC_ONLY NO_EXPRESSIONS|x86.ActiveCfg = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Debug|x86.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Default|Any CPU.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Default|Any CPU.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Default|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Default|x86.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|Any CPU.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|Any CPU.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|x86.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.MonoTouch|x86.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|x86.ActiveCfg = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.Release|x86.Build.0 = Release|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|Any CPU.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|Any CPU.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|x86.ActiveCfg = Debug|Any CPU
+ {E106F587-2DFF-4550-BA49-9A81A2EC344F}.STATIC_ONLY NO_EXPRESSIONS|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
15 src/ServiceStack.OrmLite/IOrmLiteDialectProvider.cs
@@ -12,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.Linq.Expressions;
namespace ServiceStack.OrmLite
{
@@ -114,5 +115,19 @@ public interface IOrmLiteDialectProvider
string GetColumnTypeDefinition(Type fieldType);
string GetDropForeignKeyConstraints(ModelDefinition modelDef);
+
+ #region DDL
+ string ToAddColumnStatement (Type modelType, FieldDefinition fieldDef);
+ string ToAlterColumnStatement(Type modelType, FieldDefinition fieldDef);
+ string ToChangeColumnNameStatement(Type modelType, FieldDefinition fieldDef, string oldColumnName);
+ string ToAddForeignKeyStatement<T,TForeign>(Expression<Func<T,object>> field,
+ Expression<Func<TForeign,object>> foreignField,
+ OnFkOption onUpdate,
+ OnFkOption onDelete,
+ string foreignKeyName=null);
+ string ToCreateIndexStatement<T>(Expression<Func<T,object>> field,
+ string indexName=null, bool unique=false);
+ #endregion DDL
+
}
}
View
24 src/ServiceStack.OrmLite/ModelDefinition.cs
@@ -13,6 +13,7 @@
using System.Collections.Generic;
using System.Linq;
using ServiceStack.DataAnnotations;
+using System.Linq.Expressions;
namespace ServiceStack.OrmLite
{
@@ -96,6 +97,29 @@ public FieldDefinition[] AllFieldDefinitionsArray
}
public List<CompositeIndexAttribute> CompositeIndexes { get; set; }
+
+
+ public FieldDefinition GetFieldDefinition<T>(Expression<Func<T,object>> field)
+ {
+ var fn = GetFieldName (field);
+ return FieldDefinitions.First(f=>f.Name==fn );
+ }
+
+ string GetFieldName<T>(Expression<Func<T,object>> field){
+
+ var lambda = (field as LambdaExpression);
+ if( lambda.Body.NodeType==ExpressionType.MemberAccess)
+ {
+ var me = lambda.Body as MemberExpression;
+ return me.Member.Name;
+ }
+ else
+ {
+ var operand = (lambda.Body as UnaryExpression).Operand ;
+ return (operand as MemberExpression).Member.Name;
+ }
+ }
+
}
View
7 src/ServiceStack.OrmLite/OrmLiteConnectionFactory.cs
@@ -133,7 +133,12 @@ public IDbConnection OpenDbConnection(string connectionKey)
public void RegisterConnection(string connectionKey, string connectionString, IOrmLiteDialectProvider dialectProvider, bool autoDisposeConnection = true)
{
- NamedConnections[connectionKey] = new OrmLiteConnectionFactory(connectionString, autoDisposeConnection, dialectProvider, autoDisposeConnection);
+ RegisterConnection(connectionKey, new OrmLiteConnectionFactory(connectionString, autoDisposeConnection, dialectProvider, autoDisposeConnection));
+ }
+
+ public void RegisterConnection(string connectionKey, OrmLiteConnectionFactory connectionFactory)
+ {
+ NamedConnections[connectionKey] = connectionFactory;
}
}
View
137 src/ServiceStack.OrmLite/OrmLiteDDLExtensions.cs
@@ -0,0 +1,137 @@
+using System;
+using System.Data;
+using System.Linq.Expressions;
+
+namespace ServiceStack.OrmLite
+{
+ public enum OnFkOption{
+ Cascade,
+ SetNull,
+ NoAction,
+ SetDefault,
+ Restrict
+ }
+
+ public static class OrmLiteDDLExtensions
+ {
+ public static void AlterTable<T>(this IDbConnection dbConn, string command)
+ {
+ AlterTable(dbConn, typeof(T),command);
+ }
+
+ public static void AlterTable(this IDbConnection dbConn, Type modelType, string command)
+ {
+ string sql = string.Format("ALTER TABLE {0} {1};",
+ OrmLiteConfig.DialectProvider.GetQuotedTableName( modelType.GetModelDefinition()),
+ command);
+ dbConn.ExecuteSql(sql);
+ }
+
+ public static void AddColumn<T>(this IDbConnection dbConn,
+ Expression<Func<T,object>> field)
+ {
+ var modelDef = ModelDefinition<T>.Definition;
+ var fieldDef = modelDef.GetFieldDefinition<T>(field);
+ dbConn.AddColumn(typeof(T), fieldDef);
+ }
+
+
+ public static void AddColumn(this IDbConnection dbConn, Type modelType, FieldDefinition fieldDef)
+ {
+ var command = OrmLiteConfig.DialectProvider.ToAddColumnStatement(modelType, fieldDef);
+ dbConn.ExecuteSql(command);
+ }
+
+
+ public static void AlterColumn<T>(this IDbConnection dbConn, Expression<Func<T,object>> field)
+ {
+ var modelDef = ModelDefinition<T>.Definition;
+ var fieldDef = modelDef.GetFieldDefinition<T>(field);
+ dbConn.AlterColumn(typeof(T), fieldDef);
+ }
+
+ public static void AlterColumn(this IDbConnection dbConn, Type modelType, FieldDefinition fieldDef)
+ {
+ var command = OrmLiteConfig.DialectProvider.ToAlterColumnStatement(modelType, fieldDef);
+ dbConn.ExecuteSql(command);
+ }
+
+
+ public static void ChangeColumnName<T>(this IDbConnection dbConn,
+ Expression<Func<T,object>> field,
+ string oldColumnName)
+ {
+ var modelDef = ModelDefinition<T>.Definition;
+ var fieldDef = modelDef.GetFieldDefinition<T>(field);
+ dbConn.ChangeColumnName(typeof(T), fieldDef, oldColumnName);
+ }
+
+ public static void ChangeColumnName(this IDbConnection dbConn,
+ Type modelType,
+ FieldDefinition fieldDef,
+ string oldColumnName)
+ {
+ var command = OrmLiteConfig.DialectProvider.ToChangeColumnNameStatement(modelType, fieldDef, oldColumnName);
+ dbConn.ExecuteSql(command);
+ }
+
+ public static void DropColumn<T>(this IDbConnection dbConn,string columnName)
+ {
+ dbConn.DropColumn(typeof(T), columnName);
+ }
+
+
+ public static void DropColumn(this IDbConnection dbConn,Type modelType, string columnName)
+ {
+ string command = string.Format("ALTER TABLE {0} DROP {1};",
+ OrmLiteConfig.DialectProvider.GetQuotedTableName(modelType.GetModelDefinition().ModelName),
+ OrmLiteConfig.DialectProvider.GetQuotedName(columnName));
+
+ dbConn.ExecuteSql(command);
+ }
+
+
+
+ public static void AddForeignKey<T,TForeign>(this IDbConnection dbConn,
+ Expression<Func<T,object>> field,
+ Expression<Func<TForeign,object>> foreignField,
+ OnFkOption onUpdate,
+ OnFkOption onDelete,
+ string foreignKeyName=null)
+ {
+ string command = OrmLiteConfig.DialectProvider.ToAddForeignKeyStatement(field,
+ foreignField,
+ onUpdate,
+ onDelete,
+ foreignKeyName);
+ dbConn.ExecuteSql (command);
+ }
+
+
+ public static void DropForeignKey<T>(this IDbConnection dbConn,string foreignKeyName)
+ {
+ string command = string.Format("ALTER TABLE {0} DROP FOREIGN KEY {1};",
+ OrmLiteConfig.DialectProvider.GetQuotedTableName(ModelDefinition<T>.Definition.ModelName),
+ OrmLiteConfig.DialectProvider.GetQuotedName(foreignKeyName));
+ dbConn.ExecuteSql(command);
+ }
+
+
+ public static void CreateIndex<T>(this IDbConnection dbConn,Expression<Func<T,object>> field,
+ string indexName=null, bool unique=false)
+ {
+ var command = OrmLiteConfig.DialectProvider.ToCreateIndexStatement(field, indexName, unique);
+ dbConn.ExecuteSql(command);
+ }
+
+
+ public static void DropIndex<T>(this IDbConnection dbConn, string indexName)
+ {
+ string command = string.Format("ALTER TABLE {0} DROP INDEX {1};",
+ OrmLiteConfig.DialectProvider.GetQuotedTableName(ModelDefinition<T>.Definition.ModelName),
+ OrmLiteConfig.DialectProvider.GetQuotedName(indexName));
+ dbConn.ExecuteSql(command);
+ }
+
+ }
+}
View
112 src/ServiceStack.OrmLite/OrmLiteDialectProviderBase.cs
@@ -19,6 +19,7 @@
using System.Diagnostics;
using ServiceStack.Common;
using System.IO;
+using System.Linq.Expressions;
namespace ServiceStack.OrmLite
{
@@ -947,5 +948,116 @@ public static ModelDefinition GetModelDefinition(Type modelType)
{
return modelType.GetModelDefinition();
}
+
+ #region DDL
+ public virtual string ToAddColumnStatement(Type modelType, FieldDefinition fieldDef)
+ {
+
+ var column = GetColumnDefinition(fieldDef.FieldName,
+ fieldDef.FieldType,
+ fieldDef.IsPrimaryKey,
+ fieldDef.AutoIncrement,
+ fieldDef.IsNullable,
+ fieldDef.FieldLength,
+ fieldDef.Scale,
+ fieldDef.DefaultValue);
+ return string.Format("ALTER TABLE {0} ADD COLUMN {1};",
+ GetQuotedTableName(modelType.GetModelDefinition().ModelName),
+ column);
+ }
+
+
+ public virtual string ToAlterColumnStatement(Type modelType, FieldDefinition fieldDef)
+ {
+ var column = GetColumnDefinition(fieldDef.FieldName,
+ fieldDef.FieldType,
+ fieldDef.IsPrimaryKey,
+ fieldDef.AutoIncrement,
+ fieldDef.IsNullable,
+ fieldDef.FieldLength,
+ fieldDef.Scale,
+ fieldDef.DefaultValue);
+ return string.Format("ALTER TABLE {0} MODIFY COLUMN {1};",
+ GetQuotedTableName(modelType.GetModelDefinition().ModelName),
+ column);
+ }
+
+ public virtual string ToChangeColumnNameStatement(Type modelType,
+ FieldDefinition fieldDef,
+ string oldColumnName)
+ {
+ var column = GetColumnDefinition(fieldDef.FieldName,
+ fieldDef.FieldType,
+ fieldDef.IsPrimaryKey,
+ fieldDef.AutoIncrement,
+ fieldDef.IsNullable,
+ fieldDef.FieldLength,
+ fieldDef.Scale,
+ fieldDef.DefaultValue);
+ return string.Format("ALTER TABLE {0} CHANGE COLUMN {1} {2};",
+ GetQuotedTableName(modelType.GetModelDefinition().ModelName),
+ GetQuotedColumnName(oldColumnName),
+ column);
+ }
+
+ public virtual string ToAddForeignKeyStatement<T,TForeign>(Expression<Func<T,object>> field,
+ Expression<Func<TForeign,object>> foreignField,
+ OnFkOption onUpdate,
+ OnFkOption onDelete,
+ string foreignKeyName=null){
+ var sourceMD = ModelDefinition<T>.Definition;
+ var fieldName = sourceMD.GetFieldDefinition (field).FieldName;
+
+ var referenceMD=ModelDefinition<TForeign>.Definition;
+ var referenceFieldName= referenceMD.GetFieldDefinition(foreignField).FieldName;
+
+ string name = GetQuotedName(foreignKeyName.IsNullOrEmpty()?
+ "fk_"+sourceMD.ModelName+"_"+ fieldName+"_"+referenceFieldName:
+ foreignKeyName);
+
+ return string.Format("ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4}){5}{6};",
+ GetQuotedTableName(sourceMD.ModelName),
+ name,
+ GetQuotedColumnName(fieldName),
+ GetQuotedTableName(referenceMD.ModelName),
+ GetQuotedColumnName(referenceFieldName),
+ GetForeignKeyOnDeleteClause(new ForeignKeyConstraint(typeof(T), onDelete: FkOptionToString( onDelete))),
+ GetForeignKeyOnUpdateClause(new ForeignKeyConstraint(typeof(T), onUpdate: FkOptionToString(onUpdate))));
+ }
+
+ public virtual string ToCreateIndexStatement<T>(Expression<Func<T,object>> field,
+ string indexName=null, bool unique=false)
+ {
+
+ var sourceMD = ModelDefinition<T>.Definition;
+ var fieldName = sourceMD.GetFieldDefinition (field).FieldName;
+
+ string name =GetQuotedName(indexName.IsNullOrEmpty()?
+ (unique?"uidx":"idx") +"_"+sourceMD.ModelName+"_"+fieldName:
+ indexName);
+
+ string command = string.Format("CREATE{0}INDEX {1} ON {2}({3});",
+ unique?" UNIQUE ": " ",
+ name,
+ GetQuotedTableName(sourceMD.ModelName),
+ GetQuotedColumnName(fieldName)
+ );
+ return command;
+ }
+
+
+ protected virtual string FkOptionToString(OnFkOption option){
+ switch(option){
+ case OnFkOption.Cascade: return "CASCADE";
+ case OnFkOption.NoAction: return "NO ACTION";
+ case OnFkOption.SetNull: return "SET NULL";
+ case OnFkOption.SetDefault: return "SET DEFAULT";
+ case OnFkOption.Restrict:
+ default: return "RESTRICT";
+ }
+ }
+
+ #endregion DDL
+
}
}
View
15 src/ServiceStack.OrmLite/ServiceStack.OrmLite.csproj
@@ -33,9 +33,9 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -44,7 +44,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
+ <Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -52,25 +52,25 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'STATIC_ONLY NO_EXPRESSIONS|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<OutputPath>bin\STATIC_ONLY NO_EXPRESSIONS\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MonoTouch|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<OutputPath>bin\MonoTouch\</OutputPath>
<DefineConstants>TRACE;DEBUG;STATIC_ONLY NO_EXPRESSIONS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
@@ -138,6 +138,7 @@
<Compile Include="Expressions\SqlExpressionVisitor.cs" />
<Compile Include="Expressions\WriteExtensions.cs" />
<Compile Include="Expressions\Sql.cs" />
+ <Compile Include="OrmLiteDDLExtensions.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
View
194 tests/ServiceStack.OrmLite.FirebirdTests/ForeignKeyAttributeTests.cs
@@ -0,0 +1,194 @@
+using NUnit.Framework;
+using ServiceStack.DataAnnotations;
+
+namespace ServiceStack.OrmLite.FirebirdTests
+{
+ [TestFixture]
+ public class ForeignKeyAttributeTests : OrmLiteTestBase
+ {
+ [TestFixtureSetUp]
+ public void Setup()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<ReferencedType>(true);
+ }
+ }
+
+ [Test]
+ public void CanCreateSimpleForeignKey()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithSimpleForeignKey>(true);
+ }
+ }
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteCascade()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteCascade>(true);
+ }
+ }
+
+ [Test]
+ public void CascadesOnDelete()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteCascade>(true);
+
+ db.Save(new ReferencedType { Id = 1 });
+ db.Save(new TypeWithOnDeleteCascade { RefId = 1 });
+
+ Assert.AreEqual(1, db.Select<ReferencedType>().Count);
+ Assert.AreEqual(1, db.Select<TypeWithOnDeleteCascade>().Count);
+
+ db.Delete<ReferencedType>(r => r.Id == 1);
+
+ Assert.AreEqual(0, db.Select<ReferencedType>().Count);
+ Assert.AreEqual(0, db.Select<TypeWithOnDeleteCascade>().Count);
+ }
+ }
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteCascadeAndOnUpdateCascade()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteAndUpdateCascade>(true);
+ }
+ }
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteNoAction()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteNoAction>(true);
+ }
+ }
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteRestrict()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteRestrict>(true);
+ }
+ }
+
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteSetDefault()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteSetDefault>(true);
+ }
+ }
+
+ [Test]
+ public void CanCreateForeignWithOnDeleteSetNull()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.CreateTable<TypeWithOnDeleteSetNull>(true);
+ }
+ }
+
+ [TestFixtureTearDown]
+ public void TearDwon()
+ {
+ using (var db = ConnectionString.OpenDbConnection())
+ {
+ db.DropTable<TypeWithOnDeleteAndUpdateCascade>();
+ db.DropTable<TypeWithOnDeleteSetNull>();
+ db.DropTable<TypeWithOnDeleteSetDefault>();
+ db.DropTable<TypeWithOnDeleteRestrict>();
+ db.DropTable<TypeWithOnDeleteNoAction>();
+ db.DropTable<TypeWithOnDeleteCascade>();
+ db.DropTable<TypeWithSimpleForeignKey>();
+ db.DropTable<ReferencedType>();
+ }
+ }
+ }
+
+ public class ReferencedType
+ {
+ public int Id { get; set; }
+ }
+
+
+ [Alias("TWSKF")]
+ public class TypeWithSimpleForeignKey
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+ [References(typeof(ReferencedType))]
+ public int RefId { get; set; }
+ }
+
+ [Alias("TWODC")]
+ public class TypeWithOnDeleteCascade
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [ForeignKey(typeof(ReferencedType), OnDelete = "CASCADE", ForeignKeyName="FK_DC")]
+ public int? RefId { get; set; }
+ }
+
+ [Alias("TWODUC")]
+ public class TypeWithOnDeleteAndUpdateCascade
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [ForeignKey(typeof(ReferencedType), OnDelete = "CASCADE", OnUpdate = "CASCADE", ForeignKeyName="FK_DC_UC")]
+ public int? RefId { get; set; }
+ }
+
+ [Alias("TWODNA")]
+ public class TypeWithOnDeleteNoAction
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [ForeignKey(typeof(ReferencedType), OnDelete = "NO ACTION", ForeignKeyName="FK_DNA")]
+ public int? RefId { get; set; }
+ }
+
+ [Alias("TWODNR")]
+ public class TypeWithOnDeleteRestrict
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [ForeignKey(typeof(ReferencedType), OnDelete = "RESTRICT", ForeignKeyName="FK_DR")]
+ public int? RefId { get; set; }
+ }
+
+ [Alias("TWODDF")]
+ public class TypeWithOnDeleteSetDefault
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [Default(typeof(int), "17")]
+ [ForeignKey(typeof(ReferencedType), OnDelete = "SET DEFAULT", ForeignKeyName="FK_DDF")]
+ public int RefId { get; set; }
+ }
+
+ [Alias("TWODSN")]
+ public class TypeWithOnDeleteSetNull
+ {
+ [AutoIncrement]
+ public int Id { get; set; }
+
+ [ForeignKey(typeof(ReferencedType), OnDelete = "SET NULL", ForeignKeyName="FKSN")]
+ public int? RefId { get; set; }
+ }
+}
View
3  tests/ServiceStack.OrmLite.FirebirdTests/OrmLiteTestBase.cs
@@ -14,7 +14,8 @@ public class OrmLiteTestBase
protected string GetFileConnectionString()
{
- return "User=SYSDBA;Password=masterkey;Database=D:\\ormlite-tests.fdb;DataSource=localhost;Dialect=3;charset=ISO8859_1;MinPoolSize=0;MaxPoolSize=100";
+ // add ormlite-tests.fdb = D:\\ormlite-tests.fdb to your firebird alias.conf
+ return "User=SYSDBA;Password=masterkey;Database=ormlite-tests.fdb;DataSource=localhost;Dialect=3;charset=ISO8859_1;MinPoolSize=0;MaxPoolSize=100";
}
protected void CreateNewDatabase()
View
11 tests/ServiceStack.OrmLite.FirebirdTests/ServiceStack.OrmLite.FirebirdTests.csproj
@@ -11,22 +11,22 @@
<AssemblyName>ServiceStack.OrmLite.FirebirdTests</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
+ <ConsolePause>False</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <ConsolePause>false</ConsolePause>
+ <ConsolePause>False</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -119,6 +119,7 @@
<Compile Include="OrmLiteGetScalarTests.cs" />
<Compile Include="DateTimeColumnTest.cs" />
<Compile Include="OrmLiteCreateTableWithNamigStrategyTests.cs" />
+ <Compile Include="ForeignKeyAttributeTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
Please sign in to comment.
Something went wrong with that request. Please try again.