/// <summary> /// Initializes a new instance of the QueryRecordValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="isNull">If set to <c>true</c> the record value is null.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryRecordValue(QueryRecordType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.Type = type; this.isNull = isNull; this.SetupInitialMemberValues(); }
internal void SetReferenceValue(QueryStructuralValue entityValue) { ExceptionUtilities.CheckArgumentNotNull(entityValue, "entityValue"); this.EntityValue = entityValue; // compute key value QueryEntityType entityType = this.Type.QueryEntityType; var keyType = new QueryRecordType(this.EvaluationStrategy); keyType.AddProperties(entityType.Properties.Where(m => m.IsPrimaryKey)); this.KeyValue = keyType.CreateNewInstance(); for (int i = 0; i < keyType.Properties.Count; i++) { this.KeyValue.SetMemberValue(i, entityValue.GetValue(keyType.Properties[i].Name)); } var set = entityType.EntitySet; this.EntitySetFullName = set.Container.Name + "." + set.Name; }