Is there not a reason you can do this?
void Send(Guid param)
{
ChunkA();
doSend(param);
ChunkB();
}
void Send(Int32 param)
{
ChunkA();
doSend(param);
ChunkB();
}
void ChunkA()
{
//lots of code
}
void ChunkB()
{
//lots of code
}
Also, if you're expecting only those two types... using generics would be a slight abuse of it. You might want to step back and rethink your design.
Edit:
Since you mentioned in the comments that the code in common is logging and error-handling, I think it makes even more sense to make an overload of Send
for Guid
and Int32
. You could have a Send
method that looks more like this:
void Send(Guid param)
{
try
{
LogSend(param);
doSend(param);
}
catch (SendException e)
{
HandleSendException(e, param);
}
}