Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
command.ReadList<Product>(ReadProduct) is absolute
Cassie Mod
Jun 9 2016 11:11 AM
305
Reply
HI I've got the following method. It gives the error "Command.ReadList<Product>(ReadProduct) is absolute, use dapper instead. How can I fix this ??
here is my method
public
static
List<Product> LoadProducts(SqlConnection connection, SqlTransaction transaction, HostedType? HostedType, Platforms? Platform)
{
using
(var command = connection.CreateCommand())
{
command.Transaction = transaction;
command.CommandText =
"SELECT "
+ _fields +
" FROM Products INNER JOIN ProductGroups "
+
"ON Products.ProductGroupId = ProductGroups.GroupId "
+
"WHERE 1=1 "
;
if
(HostedType.HasValue)
{
command.CommandText +=
"AND Products.HostedTypeId = @HostedTypeId OR Products.HostedTypeId IS NULL "
;
command.Parameters.Add(
"@HostedTypeId"
, SqlDbType.Int).Value = HostedType.Value;
}
if
(Platform.HasValue)
{
command.CommandText +=
"And Products.PlatformId = @PlatformId OR Products.PlatformId IS NULL"
;
command.Parameters.Add(
"@PlatformId"
, SqlDbType.Int).Value = Platform.Value;
}
return
command.ReadList<Product>(ReadProduct);
// this part is abolsute , how can I fix this ? now it it crashing in my unit test
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Dynamic Crm CustomActivity
Pl Correct it one class,one interface in interface concept