When i try to update i get error:
- can not convert guid to string
- can not convert bool to bit
- can not convert datetime to string
I use this query:
bool Approved = false;
Update up = new Update(Tables.TbNewsComment)
.Set(TbNewsComment.Columns.NewsCommentApproved).EqualTo(Approved);
if (Approved)
{
up = up.Set(TbNewsComment.Columns.NewsCommentApprovedDate)
.EqualTo(DateTime.UtcNow)
.Set(TbNewsComment.Columns.UserId)
.EqualTo(SecurityTools.currentUserProviderkey);
}
int rows = up.Where(TbNewsComment.Columns.NewsCommentId).In(ids).Execute();
I try to use old model and it word correct :-))
Query q = new Query(TbNewsComment.Schema);
q.QueryType = QueryType.Update;
q.AddUpdateSetting(TbNewsComment.Columns.NewsCommentApproved, Approved);
if (Approved)
{
q = q.AddUpdateSetting(TbNewsComment.Columns.NewsCommentApprovedDate,DateTime.UtcNow);
q = q.AddUpdateSetting(TbNewsComment.Columns.UserId, SecurityTools.currentUserProviderkey);
}
q.IN(TbNewsComment.Columns.NewsCommentId, ids).Execute();