Add repository and datacontext construction