Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VS 2013 can not evaluate expression
Message
From
08/08/2014 15:15:52
 
General information
Forum:
ASP.NET
Category:
Troubleshooting
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01605242
Message ID:
01605351
Views:
41
This message has been marked as a message which has helped to the initial question of the thread.
>>Without knowing more detail on the layers it's hard to say. But I'd be inclined to leave the base class alone. If you do that you could simply add an additional method to the child class. So given an implicit cast to 'ShortOperator' you could just add a method:
public IEnumerable<ShortOperator> GetAllShortOperators()
>> {
>>     return  _operatorRepository.GetAll().Select((x => (ShortOperator)(x)));
>>  }
>
>
>I got this
>
>
>public IEnumerable<OperatorList> GetAllOperatorsList()
>        {
>            return _operatorRepository.GetAll().
>                Select((o=> new OperatorList{ OpCode = o.OpCode, 
>                    FirstName = o.FirstName, LastName = o.LastName, 
>                    Hidden = o.Hidden, OpCodeHash = o.OpCodeHash })
>                           );
>        }
>
>but not sure how to create a similar method for PagedResult
>
> //public PagedResult<OperatorList> GetOperators(QueryRequest queryRequest)
>        //{
>        //    return _operatorRepository.GetPagedRequest(queryRequest).Select((x=> (OperatorList)(x)));
>        //}
>
>as GetPagedRequest doesn't have Select method.

Can't you add the select to _operatorRepository or queryRequest?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform