locked
I think they called expressions issue RRS feed

  • Question

  • User1034446946 posted

    Hi

    I have this:

         public static IMappingExpression<TSource, TDestination> FixRootDest<TSource, TDestination>(this IMappingExpression<TSource, TDestination> mappingExpression)
    where TDestination : RootDest
    {
    mappingExpression.ForMember(dest => dest.Value1, opt => opt.Ignore());
    mappingExpression.ForMember(dest => dest.Value2, opt => opt.Ignore());
    mappingExpression.ForMember(dest => dest.Value3, opt => opt.Ignore());
    mappingExpression.ForMember(dest => dest.Value4, opt => opt.Ignore());
    mappingExpression.ForMember(dest => dest.Value5, opt => opt.Ignore());

    return mappingExpression;
    }

    However how do i state that both the TSource and the TDesination both inherit from the RootDest

    Sunday, April 8, 2012 8:10 PM

Answers

  • User1779161005 posted

    class Foo<T1, T2>

       where T1 : IFoo

       where T2 : IBar

    {

    ...

    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 8, 2012 9:24 PM

All replies

  • User1779161005 posted

    class Foo<T1, T2>

       where T1 : IFoo

       where T2 : IBar

    {

    ...

    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 8, 2012 9:24 PM
  • User1034446946 posted

    Many thanks, don't suppose you have a link to a tutorial or examples on how to do learn more about it?

    Sunday, April 8, 2012 9:44 PM
  • User1779161005 posted

    You mean generics? Sure, here's one.

    Sunday, April 8, 2012 9:46 PM