Skip to content

Instantly share code, notes, and snippets.

@rofr
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rofr/9525679 to your computer and use it in GitHub Desktop.
Save rofr/9525679 to your computer and use it in GitHub Desktop.
Single letter generic type params or descriptive with T-prefix?
public class LocalEngineClient<TModel> : IEngine<TModel> where TModel : Model
{
public readonly Engine<TModel> Engine;
public LocalEngineClient(Engine<TModel> engine)
{
Engine = engine;
}
public TResult Execute<TResult>(Query<TModel, TResult> query)
{
return Engine.Execute(query);
}
public void Execute(Command<TModel> command)
{
Engine.Execute(command);
}
public TResult Execute<TResult>(Command<TModel, TResult> command)
{
return Engine.Execute(command);
}
public TResult Execute<TResult>(Func<TModel, TResult> query)
{
return Engine.Execute(query);
}
}
public class LocalEngineClient<M> : IEngine<M> where M : Model
{
public readonly Engine<M> Engine;
public LocalEngineClient(Engine<M> engine)
{
Engine = engine;
}
public R Execute<R>(Query<M,R> query)
{
return Engine.Execute(query);
}
public void Execute(Command<M> command)
{
Engine.Execute(command);
}
public R Execute<R>(Command<M, R> command)
{
return Engine.Execute(command);
}
public R Execute<R>(Func<M, R> query)
{
return Engine.Execute(query);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment