Home > Net >  Linq results "state" field using the enumeration Name replacement how to implement
Linq results "state" field using the enumeration Name replacement how to implement

Time:09-15

 var query=(from p in dc. ProgramHead 
The join u in dc. USER on p.R equestor equals u.U SERID
Where p.P aymentMethod=="Product"
& & (new int? [] {3, 7, 8, 9, 10, 11, 12}). The Contains (p. Tate)
& & P.F unctionId!=null
Orderby p.P GM_NO item first-just
Select new ProgramHeadReport ()
{
OralceOrder=p.O racleOrderNumber,
PGM_NO=p.P GM_NO,
The Requestor=u.F IRSTNAME + "" + u.L ASTNAME,
ShipmentDate=p. hipmentDate,
State=Enum. GetName (typeof (ADFSystem. BasicItem. The Program_State), p. Tate)
}). ToList ();


This written compilation is not an error, an error:
LINQ to Entities does not recognize the method 'System. String GetName (System...

Don't use this solution, how to implement the better ah, beg god give directions!!!!!!







CodePudding user response:

State=Enum. GetName (typeof (ADFSystem. BasicItem. The Program_State), p. Tate)

CodePudding user response:

Can only use the cycle
  •  Tags:  
  • LINQ
  • Related