This is a migrated thread and some comments may be shown as answers.

Linq query error

1 Answer 46 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Iftekhar Ivaan
Top achievements
Rank 1
Iftekhar Ivaan asked on 31 Mar 2009, 12:45 AM
Why do i get error when I do the following query.

 

var tmp = from b in scope.Extent<BusinessRequirement>() where b.Dbid > 0 select b;

 

 

 

foreach (BusinessRequirement obj in tmp)

 

{

System.Diagnostics.

Debug.WriteLine(obj.Dbid);

 

}



Identifier 'Dbid' is not a parameter, variable or field of 'Paxovision.Galaxy.Entity.BusinessRequirement'. If 'Dbid' is a property please add the FieldAlias attribute to it.

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 31 Mar 2009, 02:55 PM
Hello Iftekhar Ivaan,
when you encapsulate your fields with properties you need to add a field allies above the property pointing to the corresponding field. For example if your field name is dbid of type int it should look like this:
        private int dbid; 
[Telerik.OpenAccess.FieldAlias("dbid")] 
        public int Dbid 
        { 
            get { return dbid; } 
            set { this.dbid = value; } 
        } 


Regards,
PetarP
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
LINQ (LINQ specific questions)
Asked by
Iftekhar Ivaan
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or