I am using a silverlight business application using wcf ria services.
in my domain class there is a method
public IQueryable<Employee> GetEmployees()
{
return this.ObjectContext.Employees;
}
this method returns al the field in the table and i can bind it to datagrid. table contains employee id,employee name and age fields.
Now i want to take only one or two fields from this table.
i mean i need employee name and age ,not id.
or i need to use employee name to bind to combobox.
How can i do this?
(sorry for my bad english)
If you method return type is IQueryable<Employee> you have to return IQueryable<Employee>.
If you want to return other type you can do:
And then create a query method:
Now you can load the query on the client and it will return a list of EmployeeDTO (with only Name and Age)