I'm using C#.NET 2.0. LLBLGen info is shown below:
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.0.0.0
// Code is generated on: Tuesday, August 07, 2007 5:14:28 PM
// Code is generated using templates: SD.TemplateBindings.SqlServerSpecific.NET20
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
I want to add filter with wildcard and I referenced
http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=8248
My source code is shown below:
EntityCollection<AccrualMasterTEntity> accrualMasterEntity = new EntityCollection<AccrualMasterTEntity>();
IPredicateExpression selectFilter = new PredicateExpression();
selectFilter.Add(AccrualMasterTFields.Conum == 2);
IExpression leftOperand = new Expression(AccrualMasterTFields.EmpStatus);
EntityField2 ContentsField = AccrualMasterTFields.EmpStatus.SetExpression(leftOperand);
string rightOperand = "F%";
selectFilter.AddWithAnd(new FieldLikePredicate(ContentsField, rightOperand));
Code doesn't build. Error occurs at the place of FieldLikePredicate:
Argument '1': cannot convert from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityField2' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField'
I tried to change 'EntityField2 ContentsField = ..." into "EntityField ContentsField = ...", then error occurs at AccrualMasterTFields.EmpStatus, with the same error message.
Why this happen and how to solve?
Thanks a million!!