public void AliasToBeanResultTransformerIsSerializable() { TestsContext.AssumeSystemTypeIsSerializable(); var rt = new AliasToBeanResultTransformer(typeof(StudentDTO)); NHAssert.IsSerializable(rt); }
public static IQueryOver <TRoot, TSubType> TransformUsingAliasToBean <TRoot, TSubType>(this IQueryOver <TRoot, TSubType> query, Type resultType) { ITupleSubsetResultTransformer resultTransformer = new AliasToBeanResultTransformer(resultType); var criteria = query.UnderlyingCriteria as NHibernate.Impl.CriteriaImpl; if (criteria != null) { resultTransformer = new CacheableAliasToBeenResultTransformer(resultTransformer, criteria.Projection.Aliases); } return(query.TransformUsing(resultTransformer)); }
public void AliasToBeanResultTransformer_ShouldHaveEqualityBasedOnCtorParameter() { var transformer1 = new AliasToBeanResultTransformer(typeof(object)); var transformer2 = new AliasToBeanResultTransformer(typeof(object)); transformer1.Should().Be.EqualTo(transformer2); transformer1.GetHashCode().Should().Be.EqualTo(transformer2.GetHashCode()); var transformer3 = new AliasToBeanResultTransformer(typeof(int)); transformer1.Should().Not.Be.EqualTo(transformer3); transformer1.GetHashCode().Should().Not.Be.EqualTo(transformer3.GetHashCode()); }
public void AliasToBeanResultTransformer_ShouldHaveEqualityBasedOnCtorParameter() { var transformer1 = new AliasToBeanResultTransformer(typeof(object)); var transformer2 = new AliasToBeanResultTransformer(typeof(object)); Assert.That(transformer1, Is.EqualTo(transformer2)); Assert.That(transformer1.GetHashCode(), Is.EqualTo(transformer2.GetHashCode())); var transformer3 = new AliasToBeanResultTransformer(typeof(int)); Assert.That(transformer1, Is.Not.EqualTo(transformer3)); Assert.That(transformer1.GetHashCode(), Is.Not.EqualTo(transformer3.GetHashCode())); }
public void ResultTransformes() { IResultTransformer rt = new RootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new AliasToBeanConstructorResultTransformer(typeof(StudentDTO).GetConstructor(System.Type.EmptyTypes)); NHAssert.IsSerializable(rt); rt = new AliasToBeanResultTransformer(typeof(StudentDTO)); NHAssert.IsSerializable(rt); rt = new DistinctRootEntityResultTransformer(); NHAssert.IsSerializable(rt); rt = new PassThroughResultTransformer(); NHAssert.IsSerializable(rt); }
public void AliasToBeanResultTransformerIsSerializable() { var rt = new AliasToBeanResultTransformer(typeof(StudentDTO)); NHAssert.IsSerializable(rt); }
public EntityToModelResultTransformer() { _innerTransformer = new AliasToBeanResultTransformer(typeof(TTarget)); }
public AliasToBeanWithCallbackTransformer(Action <T> callback) { this.callback = callback; this.aliasToBeanTransformer = new AliasToBeanResultTransformer(typeof(T)); }
public AliasToBeanVMFromRecord(Del cb) { this.aliasToBeanTransformer = new AliasToBeanResultTransformer(typeof(RankingPartRecord)); _callback = cb; }