Example #1
0
        public void Test_RequestWithoutProfile_FindsDefaultConfig()
        {
            var defaultConfig    = new CrudRequestConfig <CreateUserWithResponseRequest>();
            var createUserConfig = _profileManager.GetRequestConfigFor <CreateUserWithResponseRequest>();

            Assert.IsNotNull(defaultConfig);
            Assert.IsNotNull(createUserConfig);
            Assert.AreEqual(defaultConfig.GetType(), createUserConfig.GetType());
        }
Example #2
0
        protected CrudRequestHandler(IEntityContext context, CrudConfigManager profileManager)
        {
            Context       = context;
            RequestConfig = profileManager.GetRequestConfigFor <TRequest>();
            DataContext   = new DataContext <TEntity>(RequestConfig);

            var errorHandler = RequestConfig.ErrorConfig.GetErrorHandlerFor <TEntity>();

            ErrorDispatcher = new CrudErrorDispatcher(errorHandler);
        }
 public UniversalRequestDecorator(CrudConfigManager profileManager,
                                  Func <IRequestHandler <TRequest> > decorateeFactory)
 {
     _decorateeFactory = decorateeFactory;
     _requestConfig    = profileManager.GetRequestConfigFor <TRequest>();
 }