Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VS 2013 can not evaluate expression
Message
 
 
À
07/08/2014 11:34:17
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01605242
Message ID:
01605350
Vues:
46
>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform