From: Radu B. (JIRA) <nh...@gm...> - 2011-05-29 00:02:38
|
[ http://216.121.112.228/browse/NH-2486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21215#action_21215 ] Radu Ban commented on NH-2486: ------------------------------ same as NH-2645 and NH-2380 > Distinct() extension method problem with Object Initialisers > ------------------------------------------------------------ > > Key: NH-2486 > URL: http://216.121.112.228/browse/NH-2486 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: David Siew > Priority: Minor > > This code will fail: > var data = (from v in this.GetSession().Query<WorkCellLoadGraphData>() > where v.WorkCellId == "13" > select > new WorkCellLoadGraphData > { > RowId = v.RowId, > WorkCellId = v.WorkCellId, > WorkCellName = v.WorkCellName, > WorkCellGroupId = v.WorkCellGroupId, > WorkCellGroupName = v.WorkCellGroupName > }); > return data.Distinct(); > However, running this code: > var data = (from v in this.GetSession().Query<WorkCellLoadGraphData>() > where v.WorkCellId == "13" > select v > ); > return data.Distinct(); > will "work". > The error I get is: "Expression type 10005 is not supported by this SelectClauseVisitor." -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |