This project has moved. For the latest updates, please go here.

(DataTypes.LookupId) "mystring" result in null?

Feb 3 at 8:52 AM
hi all,

i'm using the following syntax for my query building:
  SPUser currentUserLocal;

            var expressions = new List<Expression<Func<SPListItem, bool>>>();

            foreach (string loginName in ...))
            {
                  string userId = loginName;

                expressions.Add(x => (string)x[SPFieldNames.CaseResponsible.ToString()] == ((DataTypes.LookupId)userId).ToString());
             }
this results in a null pointer exception once I try to generate the query.
Also I notice in the debugger that the expression
(DataTypes.LookupId)userId
results in null.

If I look in the source code for the class "BaseFieldType" I see null is returned?
And the class 'LookupId' has a todo in it. Am I using the wrong version or something?
As the main page states you can use LookupId in the query builder (quick start section)
public class BaseFieldType
    {
        public static explicit operator BaseFieldType(string s) { return null; }
    }

 public class LookupId : BaseFieldTypeWithOperators
        {
            // todo: allow cast from integer to LookupId
//            public static explicit operator LookupId(int id)
//            {
//                return null;
//            }
        }