Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
iam use this code but see error
Error 70 Cannot convert lambda expression to type 'string' because it is not a delegate x.pose wrong
C#
   public IList<User> GetSliderImages()
       {
           var q = db.Users.Include(x=>x.Post).OrderByDescending(x => x.FPersonalUser).Where(x => x.typemanger == 1).ToList();
           return q;

       }

  public class User
   {
       [Key]
       public int ID_User { set; get; }
       public Int16 ID_post { set; get; }
       public bool Fbofd { set; get; }
       public string FuserName { set; get; }
       public bool Foffice { set; get; }
       public byte[] FPicaddress { set; get; }
       public IList<Post> _post { set; get; }
   }

public partial class Post
   {
       [Key]
       public int ID_Post { set; get; }
       public string FNamePost { set; get; }

   }
Posted
Updated 23-Feb-15 8:09am
v2
Comments
Zoltán Zörgő 23-Feb-15 14:18pm    
I have a feeling that you are using Include[^] in the wrong way. Do you neally need include?

What was your intention?
saeed1364 23-Feb-15 14:26pm    
iam need query with all filed user with filed Fnamepost
Richard Deeming 23-Feb-15 14:52pm    
Your User class as posted doesn't contain properties called Post, FPersonalUser, or typemanger.

Either you've posted the wrong class, or the GetSliderImages function is completely wrong.
saeed1364 23-Feb-15 15:08pm    
iam need this fileds same table
public int ID_User { set; get; }
public Int16 ID_post { set; get; }
public bool Fbofd { set; get; }
public string FuserName { set; get; }
public bool Foffice { set; get; }
public byte[] FPicaddress { set; get; }
public string FNamePost { set; get; }

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900