Skip to content

Commit c077bd2

Browse files
authored
[Async]GetList didn't need a check for primary key
1 parent a043923 commit c077bd2

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Dapper.SimpleCRUD/SimpleCRUDAsync.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ public static async Task<T> GetAsync<T>(this IDbConnection connection, object id
8181
public static Task<IEnumerable<T>> GetListAsync<T>(this IDbConnection connection, object whereConditions, IDbTransaction transaction = null, int? commandTimeout = null)
8282
{
8383
var currenttype = typeof(T);
84-
var idProps = GetIdProperties(currenttype).ToList();
85-
86-
if (!idProps.Any())
87-
throw new ArgumentException("Entity must have at least one [Key] property");
88-
8984
var name = GetTableName(currenttype);
9085

9186
var sb = new StringBuilder();
@@ -125,10 +120,6 @@ public static Task<IEnumerable<T>> GetListAsync<T>(this IDbConnection connection
125120
public static Task<IEnumerable<T>> GetListAsync<T>(this IDbConnection connection, string conditions, object parameters = null, IDbTransaction transaction = null, int? commandTimeout = null)
126121
{
127122
var currenttype = typeof(T);
128-
var idProps = GetIdProperties(currenttype).ToList();
129-
if (!idProps.Any())
130-
throw new ArgumentException("Entity must have at least one [Key] property");
131-
132123
var name = GetTableName(currenttype);
133124

134125
var sb = new StringBuilder();

0 commit comments

Comments
 (0)