/// <summary> /// Initializes a new instance of the <see cref="ObjectDeserialiserQuerySink"/> class. /// </summary> /// <param name="originalType">the original type that the query was made against.</param> /// <param name="instanceType">the type of the object that must be returned.</param> /// <param name="instanceName">Name of the instance (i.e the alias used in both the LINQ and SPARQL queries).</param> /// <param name="distinct">if set to <c>true</c> discard duplicate answers.</param> /// <param name="selectExpression">The select expression (derived from the the LINQ query). Used to help in deserialisation.</param> /// <param name="context">The data context that will monitor the objects created (not yet used).</param> public ObjectDeserialiserQuerySink( Type originalType, Type instanceType, string instanceName, bool distinct, MethodCallExpression selectExpression, RdfDataContext context) { #region Tracing #line hidden if (Logger.IsDebugEnabled) { Logger.Debug("Deserialising {0}.", instanceType.Name); } #line default #endregion SelectExpression = selectExpression; this.originalType = originalType; this.instanceType = instanceType; InstanceName = instanceName; Distinct = distinct; DataContext = context; IncomingResults = new ArrayList(); }
/// <summary> /// Assigns the <see cref="RdfDataContext"/> to the instance. /// </summary> /// <remarks> /// this is used in case it needs it to lazily load references later on. /// </remarks> /// <param name="obj">the object that has just been deserialised.</param> /// <param name="dataContext">The <see cref="RdfDataContext"/> through which the query was run that led to the instance being deserialised.</param> private void AssignDataContext(OwlInstanceSupertype obj, RdfDataContext dataContext) { if (obj != null) { obj.DataContext = DataContext; } // TODO: assign event handlers for NotifyPropertyChanged }