refactor discharge practice lambda expression
these twin methods show repetition:
public stationary expression<func<foo, fooeditdto>> editdtoselector()
{
relapse f => new fooeditdto
{
propertya = f.propertya,
propertyb = f.propertyb,
propertyc = f.propertyc,
propertyd = f.propertyd,
propertye = f.propertye
};
}
public stationary expression<func<foo, foolistdto>> listdtoselector()
{
relapse f => new foodto
{
propertya = f.propertya,
propertyb = f.propertyb,
propertyc = f.propertyc
};
}
how i refactor discharge repetition?
update: oops, i neglected plead an vicious point. fooeditdto subclass foodto.
Comments
Post a Comment