We are aiming to reduce code noise that would be common for all Controllers such as basic CRUD.
public interface IGenericController<T, Y> where T : BaseMaster
{
IEnumerable<T> Get();
T Get(Y code);
HttpResponseMessage Post(T entity);
T Put(T entity);
T Delete(Y code);
}
this would be use as
public class AuditController : GenericController<AuditRepository, int>
We could also use Composition over Inheritance approach here for code reuse however we there will still be code noises, so we make this as a choice.
I am a bit hesitant on wrapping existing .net base classes. One thing I could be sure is that the virtual methods are no longer expose for overriding.
Would there be any further complication on this approach?