This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Using the binaries in the installer for 3.1 and the nightly (7-15-2010), the following method creates sql that uses an alias that it hasn't made. In 3.0, it works correctly by using the view's name. public IQueryable<CurrentContinuousAnalysisRunOverview> GetCurrentContinuousAnalysisRunOverviews(DateTime date) { return from overview in UnitOfWork.Query<CurrentContinuousAnalysisRunOverview>().WithAggregate("HistoricalCA") where overview.AnalysisCategory.AnalysisApplication.AnalysisApplicationGroupId == this.Id && (overview.AnalysisDate == (date.Date - TimeSpan.FromDays(1)) || overview.RequiresComment) orderby overview.MaterialApplicationName, overview.TestShortName, overview.FieldName
select overview;
} Creates SQL like :
SELECTVW_I2MS_BODY_FIELD.Id,VW_I2MS_BODY_FIELD.body_table_id,VW_I2MS_BODY_FIELD.can_subcategorize_by,VW_I2MS_BODY_FIELD.cqaf_required,VW_I2MS_BODY_FIELD.datatype,VW_I2MS_BODY_FIELD.field_id,VW_I2MS_BODY_FIELD.is_result,VW_I2MS_BODY_FIELD.Length,VW_I2MS_BODY_FIELD.Nullable,VW_I2MS_BODY_FIELD.subcategory_suffix_format,VW_I2MS_BODY_FIELD.tested_date_body_field_idFROMdbo.VW_I2MS_BODY_FIELDWHEREEXISTS (SELECTt2.*FROMAnalysisConfig.ANALYSIS_APPLICATION t2INNER JOINAnalysisData.ANALYSIS_CATEGORY t1ONt0.analysis_category_id = t1.IdINNER JOINAnalysisData.ANALYSIS_CATEGORY t1ONt2.Id = t1.analysis_application_idWHEREt2.body_field_id = VW_I2MS_BODY_FIELD.Id ANDEXISTS (SELECTt1.*FROMAnalysisData.ANALYSIS_CATEGORY t1WHEREt1.analysis_application_id = t2.Id ANDEXISTS (SELECTt0.*FROMAnalysisData.VW_CONTINUOUS_ANALYSIS_RUN_OVERVIEW t0WHEREt0.analysis_category_id = t1.Id AND((EXISTS (SELECTt1.*FROMAnalysisData.ANALYSIS_CATEGORY t1WHEREt1.Id = t0.analysis_category_id ANDEXISTS (SELECTt2.*FROMAnalysisConfig.ANALYSIS_APPLICATION t2WHEREt2.Id = t1.analysis_application_id ANDt2.analysis_application_group_id = 1)) AND (t0.analysis_date = '7/13/2010 12:00:00 AM' OR t0.requires_comment = True)) AND t0.DeletedOn IS NULL))));
Any ideas? |
|
|
Hi Karen, This sounds like a bug, are you able to send through (either by attaching a sample project without any binaries to this forum post, or emailing it through to the support address) a small repro sample of this behavior and we can have a look into what is causing this.
Thanks! Jeremy |
|