All work
- Support SqlMethods.Like() with escape character in LINQNH-3726Resolved issue: NH-3726Oskar Berggren
- Incorrect SQL generated by LINQ provider in presence of GroupBy()NH-3686Resolved issue: NH-3686Alex Zaytsev
- Testcase UsingFiltersIsThreadSafe sometimes fails on MySQLNH-3663Resolved issue: NH-3663Alex Zaytsev
- Driver adjustments to DB command not loggedNH-3662
- Support Math.Round() in QueryOver projectionsNH-3647Resolved issue: NH-3647
- Permit scalar functions inside count() aggregate functionNH-3645Resolved issue: NH-3645Alex Zaytsev
- NullReferenceException in StatefulPersistenceContext.OnDeserialization() with proxies not completely deserializedNH-3574Resolved issue: NH-3574Alex Zaytsev
- AfterTransactionCompletion called twice if a distributed transaction is rolled backNH-3572Resolved issue: NH-3572Oskar Berggren
- Support the 'power' function on MS SQL ServerNH-3553Resolved issue: NH-3553
- If prepare_sql is true, columns of XML type won't workNH-3518Resolved issue: NH-3518Alex Zaytsev
- Properties not set in app.config not available in Environment.PropertiesNH-3502Resolved issue: NH-3502Alex Zaytsev
- NHibernate SqlServer2012Dialect drop sequence bugNH-3496Resolved issue: NH-3496
- Partial loading for bags produces sub-query, ignores "fetch"NH-3464Resolved issue: NH-3464Alex Zaytsev
- Nullable many-to-one relationship wrongly affected by filterNH-3461Resolved issue: NH-3461
- Collections cannot be loaded using a named query loaderNH-3440Resolved issue: NH-3440
- Merge fix for bug NH-3058 into 3.NextNH-3432Resolved issue: NH-3432
- ISession.Get<T>() becomes linearly slower as there are more entities in first-level cacheNH-3430Resolved issue: NH-3430
- Wrong parameter size in query with MsSql2000Dialect,MsSql2005Dialect and MsSql2008DialectNH-3403Resolved issue: NH-3403
- Support PostgreSQL trigonometric functionsNH-3398Resolved issue: NH-3398Oskar Berggren
- atan2 should be defined to return double on Oracle and MySqlNH-3381Resolved issue: NH-3381Oskar Berggren
- NHibernate should log LINQ expression trees to ease debuggingNH-3371Resolved issue: NH-3371Oskar Berggren
- Refactor Loader/Result Transformer interaction to match HibernateNH-3363Resolved issue: NH-3363Alex Zaytsev
- Allow setting timeout on a LINQ queryNH-3360Resolved issue: NH-3360Oskar Berggren
- QueryOver polymorphic entity results in unwanted inner joinNH-3359
- IDbDataParameter parameter.Size is set to the length of the string of the first row in collection, instead of the column size defined in the tableNH-3355Resolved issue: NH-3355
- Add mode to refuse flush outside of explicit transactionNH-3325
- Remove one of the Firebird driversNH-3322Resolved issue: NH-3322
- Remove ManagedWebSessionContextNH-3314Resolved issue: NH-3314
- Accessing collection of children in ILifecycle.OnLoad, session.Merge results in "illegal access to loading collection"NH-3306
- Refactor custom SQL code to reduce code duplication and improve maintainabilityNH-3303Resolved issue: NH-3303
- Support SqlMethods.Like() in LINQ queries.NH-3301Resolved issue: NH-3301Oskar Berggren
- New driver: Devart.Data.MySqlNH-3283Resolved issue: NH-3283Oskar Berggren
- GroupBySelectClauseRewriter fails or is suboptimal on .Net 4.0NH-3256Resolved issue: NH-3256
- AnsiString larger than 8000 doesn't work with Sql ServerNH-3252Resolved issue: NH-3252Alex Zaytsev
- Poor performance loading data due to IDataReader.GetOrdinalNH-3207Resolved issue: NH-3207
- Offset parameter is off by one for dialects with OffsetStartsAtOne set (SybaseSQLAnywhere10+)NH-3202Resolved issue: NH-3202
- Sybase ADS Dialect/DriverNH-3197
- Add ability to use ToFutureValue with aggregating queriesNH-3184Resolved issue: NH-3184
- Linq ToFuture/ToFutureValue does not fall-back if dialect does not support multi-queriesNH-3183Resolved issue: NH-3183Alex Zaytsev
- Linq - wrong SQL generated when selecting subclasses described with discriminatorsNH-3182
- Could not select first element of the groupNH-3180Resolved issue: NH-3180Alex Zaytsev
- Documentation should note that OnDelete should set IsSaved to false in chapter 24.1NH-3179Resolved issue: NH-3179Frédéric Delaporte
- "Where" and "like" causes Exception if parameter is longer than length defined in mappingNH-3177Resolved issue: NH-3177
- Ability to project collections using QueryOverNH-3176
- Inverse(False) causes StaleObjectException on a ManyToOne relationNH-3174Resolved issue: NH-3174Alex Zaytsev
- ICompositeUserType not mapping correctly after upgrading to 3.3.0.4000NH-3173Resolved issue: NH-3173Alex Zaytsev
- "Duplicate dynamic module name within an assembly"NH-3172Resolved issue: NH-3172
- Missing join in sql when restricting by composite column in criteria queryNH-3171Resolved issue: NH-3171Alex Zaytsev
- Add native "iif" function to MsSql2012DialectNH-3170Resolved issue: NH-3170Alex Zaytsev
- Add supprot for extract function for MsSql2000Dialect and aboveNH-3169Resolved issue: NH-3169Alex Zaytsev
50 of 92
ExpandedWrapper over collection property throws TargetInvocationException
Duplicate
Description
Environment
None
duplicates
Details
Details
Assignee
Unassigned
UnassignedReporter
Mattias Viberg
Mattias VibergLabels
Components
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created December 10, 2012 at 10:19 AM
Updated September 9, 2014 at 12:54 PM
Resolved December 10, 2012 at 12:26 PM
Activity
Show:
I'm using WCF Data Services (odata) over a NHibernate backend and I have encountered problems when expanding collection properties.
I have the following (simplified) model:
public class City
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual IList<Area> Areas { get; set; }
}
public class Area
{
public virtual int id { get; set; }
public virtual string Name { get; set; }
public virtual City City { get; set; }
}
If I run the following query:
var city = (from c in session.Query<City>()
where c.ID == 1
select new ExpandedWrapper<City, IList<Area>> { Description = "Areas", ProjectedProperty0 = c.Areas, ReferenceDescription = "", ExpandedElement = c }).ToList();
I get an TargetInvocationException at ResultTransformer.TransformTuple(), line 25. TransformTuple gets called with the tuple-parameter containing a city and an area (If the City contains 5 areas, TransformTuple would get called 5 times, with the tuple containing the same city and different areas for each call).
As I understand it, the ExpandedElement will be set to city ("c") from the tuple and ProjectedProperty0 to area ("c.Areas") from the tuple, but since ProjectedProperty0 expects an IList<Area> and not an Area it throws.
I'm not sure but even if the invoke would succeed, TransformTuple would get called n times, where n is the number of associated areas...and that does not seem right either.