Permalink
Browse files

fixed issue #175

  • Loading branch information...
Thomas Grassauer
Thomas Grassauer committed Feb 19, 2013
1 parent 2ba049c commit 1c5857a9ece1f7037779ec38f6b3c3fa21009d62
@@ -107,14 +107,15 @@ public void test_if_and_works_with_nullable_parameter()
db.CreateTable<TestEntity>(true);
db.Insert(new TestEntity
{
- Id = 2000,
Foo = this.RandomString(16),
Bar = this.RandomString(16),
Baz = this.RandomDecimal()
});
+ var id = (int)db.GetLastInsertId();
+
var ev = OrmLiteConfig.DialectProvider.ExpressionVisitor<TestEntity>();
- ev.Where(e => e.Id == 2000);
+ ev.Where(e => e.Id == id);
int? i = null;
ev.And(e => e.NullInt == i);
@@ -737,8 +737,8 @@ protected virtual object VisitBinary(BinaryExpression b)
}
- if (operand == "=" && right.ToString() == "null") operand = "is";
- else if (operand == "<>" && right.ToString() == "null") operand = "is not";
+ if (operand == "=" && right.ToString().Equals("null", StringComparison.InvariantCultureIgnoreCase)) operand = "is";
+ else if (operand == "<>" && right.ToString().Equals("null", StringComparison.InvariantCultureIgnoreCase)) operand = "is not";
switch (operand)
{
@@ -11,6 +11,15 @@ public void Setup()
{
using (var dbConn = ConnectionString.OpenDbConnection())
{
+ dbConn.DropTable<TypeWithOnDeleteAndUpdateCascade>();
+ dbConn.DropTable<TypeWithOnDeleteSetNull>();
+ dbConn.DropTable<TypeWithOnDeleteSetDefault>();
+ dbConn.DropTable<TypeWithOnDeleteRestrict>();
+ dbConn.DropTable<TypeWithOnDeleteNoAction>();
+ dbConn.DropTable<TypeWithOnDeleteCascade>();
+ dbConn.DropTable<TypeWithSimpleForeignKey>();
+ dbConn.DropTable<ReferencedType>();
+
dbConn.DropAndCreateTable<ReferencedType>();
}
}
@@ -14,7 +14,8 @@ public class Config
public static string SqliteFileDir = "~/App_Data/".MapAbsolutePath();
public static string SqliteFileDb = "~/App_Data/db.sqlite".MapAbsolutePath();
public static string SqlServerDb = "~/App_Data/Database1.mdf".MapAbsolutePath();
- public static string SqlServerBuildDb = "Server=pc;Database=test;User Id=pc;Password=pc;";
+ //public static string SqlServerBuildDb = "Server=pc;Database=test;User Id=pc;Password=pc;";
+ public static string SqlServerBuildDb = "Data Source=localhost;Initial Catalog=TestDb;Integrated Security=SSPI;Connect Timeout=120;MultipleActiveResultSets=True";
public static IOrmLiteDialectProvider DefaultProvider = SqlServerDialect.Provider;
public static string DefaultConnection = SqlServerBuildDb;

0 comments on commit 1c5857a

Please sign in to comment.