Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context. RRS feed

  • Question

  • List<clsPermissionsCode> lstMap = (from tblMap in objData.tblEmp_Mappings
                                               join tblUserPermissions in objData.tblUserPermissions
                                               on tblMap.EnrollNo equals tblUserPermissions.EnrollNo
                                               join tblDevice in objData.tblDeviceMasters
                                               on tblUserPermissions.DeviceId equals tblDevice.DeviceId
                                               select new clsPermissionsCode
                                                   DeviceId = tblUserPermissions.DeviceId,
                                                   UserPermissionId = tblUserPermissions.UserPermissionId,
                                                   DeviceName = tblDevice.ComputerName,
                                                   DevicePermission = tblUserPermissions.DevicePermission,
                                                   EnrollNamePrefix = tblUserPermissions.EnrollNamePrefix,
                                                   EnrollNo = tblUserPermissions.EnrollNo,
                                                   Connected = true
    Saturday, April 4, 2015 12:33 PM


  • Hello Yogesh,

    Please have a try to replace



    where == true

    Or if your active column is nullable, change it to non-nullable, then try to use


    This is a IQueryable query, so it would try to translate the LINQ query to the TSQL and the Bool?.Equals(Bool) syntax is not recognized by the LINQ to Entities provider.

    I notice that you use the Convert.ToInt32() method in the LINQ query, please note this is also recognized by the LINQ to Entities. For details, you could refer to this link:


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 6, 2015 6:36 AM