Last active
August 29, 2015 13:57
-
-
Save rofr/9525679 to your computer and use it in GitHub Desktop.
Single letter generic type params or descriptive with T-prefix?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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