Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 70aaec1

Browse files
committed
Add Cast to UntypedApi
1 parent a4f69b6 commit 70aaec1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/ServiceStack.OrmLite/IUntypedApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ public interface IUntypedApi
2222
int DeleteNonDefaults(object obj, object filter);
2323
int DeleteById(object id);
2424
int DeleteByIds(IEnumerable idValues);
25+
IEnumerable Cast(IEnumerable results);
2526
}
2627
}

src/ServiceStack.OrmLite/UntypedApi.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Concurrent;
44
using System.Collections.Generic;
55
using System.Data;
6+
using System.Linq;
67

78
namespace ServiceStack.OrmLite
89
{
@@ -100,5 +101,10 @@ public int DeleteByIds(IEnumerable idValues)
100101
{
101102
return Exec(dbCmd => dbCmd.DeleteByIds<T>(idValues));
102103
}
104+
105+
public IEnumerable Cast(IEnumerable results)
106+
{
107+
return (from object result in results select (T)result).ToList();
108+
}
103109
}
104110
}

0 commit comments

Comments
 (0)