Example #1
0
        public CustomerCustomerDemoResponse Any(CustomerCustomerDemoAddRequest request)
        {
            if (Validator != null)
            {
                Validator.ValidateAndThrow(request, ApplyTo.Post);
            }

            OnBeforeCustomerCustomerDemoAddRequest(request);

            var output = Repository.Create(request);

            OnAfterCustomerCustomerDemoAddRequest(request, output);
            return(output);
        }
        public CustomerCustomerDemoResponse Create(CustomerCustomerDemoAddRequest request)
        {
            using (var adapter = DataAccessAdapterFactory.NewDataAccessAdapter())
            {
                OnBeforeCustomerCustomerDemoAddRequest(adapter, request);

                var entity = request.FromDto();
                entity.IsNew = true;

                if (adapter.SaveEntity(entity, true))
                {
                    OnAfterCustomerCustomerDemoAddRequest(adapter, request);
                    return(new CustomerCustomerDemoResponse(entity.ToDto()));
                }
            }

            throw new InvalidOperationException();
        }
Example #3
0
 partial void OnAfterCustomerCustomerDemoAddRequest(CustomerCustomerDemoAddRequest request, CustomerCustomerDemoResponse response);
Example #4
0
 partial void OnBeforeCustomerCustomerDemoAddRequest(CustomerCustomerDemoAddRequest request);
 partial void OnAfterCustomerCustomerDemoAddRequest(IDataAccessAdapter adapter, CustomerCustomerDemoAddRequest request);