TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Cassie Mod
NA
488
71.2k
command.ReadList<Product>(ReadProduct) is absolute
Jun 9 2016 11:11 AM
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
}
}
Reply
Answers (
0
)
Dynamic Crm CustomActivity
Pl Correct it one class,one interface in interface concept