Click here to Skip to main content
16,007,932 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
this is my code

C#
var filteredQuery = ProjectProvider.GetProjects()
                                                     .Select(a => new ProjectGrid()
                                               {
                                                Id = a.Id,
                                                ClientId = a.ClientId,
                                                ProjectName = a.ProjectName,
                   this is where my error is -> StatusType = a.Status,
                                                CostCode = a.CostCode,
                                                Description = a.Description
                                                     });
Posted
Updated 1-Jul-15 2:00am
v2

In ProjectGrid make sure StatusType has a get and (non-private) set.

C#
public YourType StatusType {get; set;}


In its class definition it'll only have a "get". Or it could be that the type is computed elsewhere and isn't a standard property. If that's the case you'll need to set the class up such that its StatusType returns the status you want.

C#
public YourType StatusType
{
    get
    {
        // look at how the status type is calculated and work out
        // from that how to set it
        return SomeFunctionThatCalculatesType();
    }   
}


Given the minimal information you have posted, it is unlikely any follow-up questions can be answered, we don't know your system, its rules, we can't access your code and databases.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Jul-15 12:56pm    
Sure, a 5.
—SA
Declare the property with public <datatype> status{get;set;}
or like
public <datatype> status;
this will probably solve your problem
 
Share this answer
 

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