コード例 #1
0
        public string Create(SubscriptionCreateDTO subscription)
        {
            try
            {
                var result = subscription.ToDomainEntity();

                // Processing Phase
                using (var dbContextScope = _dbContextScopeFactory.Create())
                {
                    _repositoryFactory.Get <ISubscriptionRepository>().Create(result);
                    dbContextScope.SaveChanges();
                }

                return(result.Id);
            }
            catch (Exception e)
            {
                throw GetExceptionResponse(e);
            }
        }