示例#1
0
 public GoodsCategoryAppService(IDbUnitOfWork dbUnitOfWork, IEventBus eventBus, IGoodsCategoryRepository goodsCategoryRepository, ITagRepository tagRepository)
 {
     _dbUnitOfWork            = dbUnitOfWork;
     _eventBus                = eventBus;
     _goodsCategoryRepository = goodsCategoryRepository;
     _tagRepository           = tagRepository;
 }
示例#2
0
 public GoodsAppService(
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     IGoodsRepository goodsRepository,
     IOnlineGoodsRepository onlineGoodsRepository,
     IGoodsImageRepository goodsImageRepository,
     IGrouponConditionRepository grouponConditionRepository,
     IOnlineGoodsImageRepository onlineGoodsImageRepository,
     IOnlineGrouponConditionRepository onlineGrouponConditionRepository,
     IImageServiceProxy imageServiceProxy,
     IOrganizationServiceProxy organizationServiceProxy,
     IAmapProxy amapProxy,
     IActivityServiceProxy activityServiceProxy,
     IOrderServiceProxy orderServiceProxy,
     IAuthServiceProxy authServiceProxy,
     TmpInstanceGenerate tmp)
 {
     _tmp                              = tmp;
     _dbUnitOfWork                     = dbUnitOfWork;
     _eventBus                         = eventBus;
     _goodsRepository                  = goodsRepository;
     _onlineGoodsRepository            = onlineGoodsRepository;
     _goodsImageRepository             = goodsImageRepository;
     _grouponConditionRepository       = grouponConditionRepository;
     _onlineGoodsImageRepository       = onlineGoodsImageRepository;
     _onlineGrouponConditionRepository = onlineGrouponConditionRepository;
     _imageServiceProxy                = imageServiceProxy;
     _organizationServiceProxy         = organizationServiceProxy;
     _amapProxy                        = amapProxy;
     _activityServiceProxy             = activityServiceProxy;
     _orderServiceProxy                = orderServiceProxy;
     _authServiceProxy                 = authServiceProxy;
 }
示例#3
0
        public override async Task Invoke(AspectContext context, AspectDelegate next)
        {
            try
            {
                var           enableTransaction = false;
                IDbUnitOfWork dbUnitOfWork      = null;

                if (context.ImplementationMethod.IsDefined(typeof(EnableTransactionAttribute), false))
                {
                    enableTransaction = true;
                    var custAttr = (EnableTransactionAttribute)GetCustomAttribute(context.ImplementationMethod, typeof(EnableTransactionAttribute));
                    if (custAttr == null)
                    {
                        throw new CanNotGetAttributeException(500, "Occur a exception when get the attribute from the target method.(Can not get the attribute named \"EnableTransactionAttribute\")");
                    }
                    BindingFlags flag = BindingFlags.Instance | BindingFlags.NonPublic;
                    dbUnitOfWork = (IDbUnitOfWork)(context.Implementation.GetType().GetField("_dbUnitOfWork", flag).GetValue(context.Implementation));
                }
                using (var scope = new TransactionContext(dbUnitOfWork, enableTransaction))
                {
                    await next(context);

                    scope.Commit();
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, ex.Message);
                throw;
            }
        }
示例#4
0
        public void SetUnitOfWork(IDbUnitOfWork unitOfWork)
        {
            var efUof = (EntityFrameworkUnitOfWork)unitOfWork;

            Context       = efUof.GetDbContext(_contextType);
            InTrunsaction = () => efUof.InTransaction() || efUof.InGlobalTransaction();
        }
示例#5
0
 public CategoryAppService(IDbUnitOfWork dbUnitOfWork, IEventBus eventBus, ICategoryRepository serviceCategoryRepository, ITagRepository tagRepository)
 {
     _dbUnitOfWork = dbUnitOfWork;
     _eventBus     = eventBus;
     _serviceCategoryRepository = serviceCategoryRepository;
     _tagRepository             = tagRepository;
 }
示例#6
0
 public GrouponActivityAppService(IGrouponActivityRepository grouponActivityRepository, IGrouponParticipationRepository grouponParticipationRepository, IDbUnitOfWork dbUnitOfWork, IAuthServiceProxy authServiceProxy, IImageServiceProxy imgServiceProxy)
 {
     _grouponActivityRepository      = grouponActivityRepository;
     _grouponParticipationRepository = grouponParticipationRepository;
     _dbUnitOfWork     = dbUnitOfWork;
     _authServiceProxy = authServiceProxy;
     _imgServiceProxy  = imgServiceProxy;
 }
示例#7
0
 public GoodsShelvedEventHandler(IEventBus bus, IOnlineGoodsRepository onlineGoodsRepository, IOnlineGoodsImageRepository onlineGoodsImageRepository, IOnlineGrouponConditionRepository onlineGrouponConditionrepository, IDbUnitOfWork dbUnitOfWork)
 {
     _bus = bus;
     _onlineGoodsRepository            = onlineGoodsRepository;
     _onlineGoodsImageRepository       = onlineGoodsImageRepository;
     _onlineGrouponConditionRepository = onlineGrouponConditionrepository;
     _dbUnitOfWork = dbUnitOfWork;
 }
示例#8
0
 public CommentAppService(IDbUnitOfWork dbUnitOfWork, ICommentRepository commentRepository, ICommentTagRepository commentTagRepository, ICommentImageRepository commentImageRepository, IAuthServiceProxy authServiceProxy)
 {
     _commentRepository      = commentRepository;
     _commentTagRepository   = commentTagRepository;
     _dbUnitOfWork           = dbUnitOfWork;
     _commentImageRepository = commentImageRepository;
     _authServiceProxy       = authServiceProxy;
 }
示例#9
0
 public ServicerAppService(IServicerRepository servicerRepository, IServicerImageRepository servicerImageRepository, IDbUnitOfWork dbUnitOfWork, IImageServiceProxy imageServiceProxy, IOrganizationServiceProxy organizationServiceProxy, IAmapProxy amapProxy)
 {
     _servicerRepository       = servicerRepository;
     _servicerImageRepository  = servicerImageRepository;
     _dbUnitOfWork             = dbUnitOfWork;
     _imageServiceProxy        = imageServiceProxy;
     _organizationServiceProxy = organizationServiceProxy;
     _amapProxy = amapProxy;
 }
示例#10
0
 public TransactionContext(IDbUnitOfWork dbUnitOfWork, bool needTransaction = false)
 {
     if (needTransaction)
     {
         _dbUnitOfWork = dbUnitOfWork;
         _dbUnitOfWork.BeginTransaction();
         isEnableTransaction = true;
     }
 }
示例#11
0
 public VerificationAppService(
     IVerificationRepository verificationRepository,
     IVerificationService verificationService,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus) : base(dbUnitOfWork)
 {
     _verificationRepository = verificationRepository;
     _verificationService    = verificationService;
     _eventBus = eventBus;
 }
示例#12
0
 public UserAppService(
     IMapper mapper,
     IUserRepository userRepository,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus) : base(dbUnitOfWork)
 {
     _eventBus       = eventBus;
     _userRepository = userRepository;
     _mapper         = mapper;
 }
 public DataExchangeService(IDbUnitOfWork dbUnitOfWork)
 {
     dbUnitOfWork.ResultEvent += obj =>
     {
         var temp   = callback;
         var result = (Tuple <bool, object>)obj;
         temp.ServiceCallback(new ServiceResult(result.Item1, result.Item2).Compression());
     };
     _dbUnitOfWork = dbUnitOfWork;
 }
示例#14
0
 public CommentAppService(
     IMapper mapper,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     ICommentRepository commentRepository) : base(dbUnitOfWork)
 {
     _eventBus          = eventBus;
     _mapper            = mapper;
     _commentRepository = commentRepository;
 }
示例#15
0
 public MessageAppService(IDbUnitOfWork dbUnitOfWork,
                          IVerificationRepository verificationRepo,
                          IVerificationService verificationService,
                          IEventBus eventBus,
                          ITest test) : base(dbUnitOfWork)
 {
     _verificationRepository = verificationRepo;
     _verificationService    = verificationService;
     _eventBus = eventBus;
     _test     = test;
 }
示例#16
0
 public GrouponParticipatedEventHandler(IEventBus bus,
                                        IGrouponActivityRepository grouponActivityRepository,
                                        IGrouponParticipationRepository grouponParticipationRepository,
                                        IDbUnitOfWork dbUnitOfWork
                                        )
 {
     _bus = bus;
     _grouponActivityRepository      = grouponActivityRepository;
     _grouponParticipationRepository = grouponParticipationRepository;
     _dbUnitOfWork = dbUnitOfWork;
 }
示例#17
0
 public QuestionAppService(
     IMapper mapper,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     IQuestionRepository questionRepository,
     IQuestionTagRepository questionTagRepository) : base(dbUnitOfWork)
 {
     _eventBus              = eventBus;
     _mapper                = mapper;
     _questionRepository    = questionRepository;
     _questionTagRepository = questionTagRepository;
 }
示例#18
0
 public VerificationAppService(
     IVerificationRepository verificationRepository,
     IVerificationService verificationService,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     ITest test) : base(dbUnitOfWork)
 {
     _verificationRepository = verificationRepository;
     _verificationService    = verificationService;
     _eventBus = eventBus;// IocProvider.GetService<IEventBus>();
     _test     = test;
 }
示例#19
0
 public VerificationAppService(
     IVerificationRepository verificationRepository,
     IVerificationService verificationService,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     ISmsProxy smsProxy)
 {
     _verificationRepository = verificationRepository;
     _verificationService    = verificationService;
     _dbUnitOfWork           = dbUnitOfWork;
     _eventBus = eventBus;
     _smsProxy = smsProxy;
 }
示例#20
0
 public WeChatPaymentNotifyMessageAppService(
     IDbUnitOfWork dbUnitOfWork,
     IWeChatPaymentNotifyMessageRepository wechatPaymentNotifyMessageRepository,
     IOrderServiceProxy orderServiceProxy,
     IWeChatAppConfigurationRepository wechatAppConfigurationRepository,
     IGateways gateways)
 {
     _dbUnitOfWork = dbUnitOfWork;
     _wechatPaymentNotifyMessageRepository = wechatPaymentNotifyMessageRepository;
     _orderServiceProxy = orderServiceProxy;
     _wechatAppConfigurationRepository = wechatAppConfigurationRepository;
     _gateways = gateways;
 }
示例#21
0
 public UserAppService(ICookAppUserRepository cookappUserRepo,
                       ICookAppPartnerLoginUserRepository cookappPartnerLoginUserRepo,
                       IVerificationProxy verificationProxy,
                       IWechatProxy wechatProxy,
                       IServiceConfigurationAgent config,
                       IDbUnitOfWork unitOfWork) : base(unitOfWork)
 {
     _cookappUserRepo             = cookappUserRepo;
     _cookappPartnerLoginUserRepo = cookappPartnerLoginUserRepo;
     _verificationProxy           = verificationProxy;
     _wechatProxy = wechatProxy;
     _config      = config;
 }
示例#22
0
 public TopicAppService(ITopicRepository topicRepository,
                        IDbUnitOfWork dbUnitOfWork,
                        IOrganizationServiceProxy organizationServiceProxy,
                        IAmapProxy amapProxy,
                        ITopicImageRepository topicImageRepository,
                        IImageServiceProxy imageServiceProxy)
 {
     _topicRepository          = topicRepository;
     _dbUnitOfWork             = dbUnitOfWork;
     _organizationServiceProxy = organizationServiceProxy;
     _amapProxy            = amapProxy;
     _topicImageRepository = topicImageRepository;
     _imageServiceProxy    = imageServiceProxy;
 }
示例#23
0
 public GrouponParticipationAppService(
     IGrouponActivityRepository grouponActivityRepository,
     IGrouponParticipationRepository grouponParticipationRepository,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     IAuthServiceProxy authServiceProxy
     )
 {
     _grouponActivityRepository      = grouponActivityRepository;
     _grouponParticipationRepository = grouponParticipationRepository;
     _dbUnitOfWork     = dbUnitOfWork;
     _eventBus         = eventBus;
     _authServiceProxy = authServiceProxy;
 }
示例#24
0
 public RecommendAppService(
     IMapper mapper,
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     IRecommendRepository recommendRepository,
     IRecommendMediaRepository recommendMediaRepository,
     IRecommendSpecRepository recommendSpecRepository) : base(dbUnitOfWork)
 {
     _eventBus = eventBus;
     _mapper   = mapper;
     _recommendMediaRepository = recommendMediaRepository;
     _recommendRepository      = recommendRepository;
     _recommendSpecRepository  = recommendSpecRepository;
 }
示例#25
0
 public TagStatisticsAppService(
     ICommentTagRepository commentTagRepository,
     ITagRepository tagRepository,
     IDbUnitOfWork dbUnitOfWork,
     IServiceRepository serviceRepository,
     IServicerRepository servicerRepository,
     IReservationRepository reservationRepository)
 {
     _tagRepository         = tagRepository;
     _commentTagRepository  = commentTagRepository;
     _dbUnitOfWork          = dbUnitOfWork;
     _serviceRepository     = serviceRepository;
     _servicerRepository    = servicerRepository;
     _reservationRepository = reservationRepository;
 }
示例#26
0
 public OrderAppService(
     IDbUnitOfWork dbUnitOfWork,
     IEventBus eventBus,
     IOrderRepository orderRepository,
     IOrderItemRepository orderItemRepository,
     IOrderTraceRepository orderTraceRepository,
     IDeliveryNoteRepository deliveryNoteRepository
     )
 {
     _dbUnitOfWork           = dbUnitOfWork;
     _eventBus               = eventBus;
     _orderRepository        = orderRepository;
     _orderItemRepository    = orderItemRepository;
     _orderTraceRepository   = orderTraceRepository;
     _deliveryNoteRepository = deliveryNoteRepository;
 }
示例#27
0
 public CommentAppService(
     IDbUnitOfWork dbUnitOfWork,
     ICommentRepository commentRepository,
     ICommentTagRepository commentTagRepository,
     ICommentImageRepository commentImageRepository,
     IReservationRepository reservationRepository,
     IImageServiceProxy imageServiceProxy,
     IAuthServiceProxy authServiceProxy)
 {
     _commentRepository      = commentRepository;
     _commentTagRepository   = commentTagRepository;
     _dbUnitOfWork           = dbUnitOfWork;
     _commentImageRepository = commentImageRepository;
     _reservationRepository  = reservationRepository;
     _imageServiceProxy      = imageServiceProxy;
     _authServiceProxy       = authServiceProxy;
 }
示例#28
0
 public ServiceAppService(
     IServiceRepository serviceRepository,
     IServiceImageRepository serviceImageRepository,
     IDbUnitOfWork unitOfWork,
     IImageServiceProxy imageServiceProxy,
     IOrganizationServiceProxy organizationServiceProxy,
     IAmapProxy amapProxy,
     TmpInstanceGenerate tmp)
 {
     _tmp = tmp;
     _serviceRepository        = serviceRepository;
     _serviceImageRepository   = serviceImageRepository;
     _dbUnitOfWork             = unitOfWork;
     _imageServiceProxy        = imageServiceProxy;
     _organizationServiceProxy = organizationServiceProxy;
     _amapProxy = amapProxy;
 }
示例#29
0
 public ReservationAppService(IReservationRepository reservationRepository,
                              IDbUnitOfWork dbUnitOfWork,
                              IEventBus eventBus,
                              IServiceRepository serviceRepository,
                              IServicerRepository servicerRepository,
                              IOrganizationServiceProxy organizationServiceProxy,
                              IAmapProxy amapProxy,
                              IOrderServiceProxy orderServiceProxy)
 {
     _reservationRepository = reservationRepository;
     _dbUnitOfWork          = dbUnitOfWork;
     _eventBus                 = eventBus;
     _serviceRepository        = serviceRepository;
     _servicerRepository       = servicerRepository;
     _organizationServiceProxy = organizationServiceProxy;
     _amapProxy                = amapProxy;
     _orderServiceProxy        = orderServiceProxy;
 }
示例#30
0
 public OrderCancelledEventHandler(IEventBus bus, IOrderTraceRepository orderTraceRepository, IDbUnitOfWork dbUnitOfWork)
 {
     _orderTraceRepository = orderTraceRepository;
     _bus          = bus;
     _dbUnitOfWork = dbUnitOfWork;
 }
 public MessagesController(IDbUnitOfWork dbUnitOfWork)
 {
     _dbUnitOfWork = dbUnitOfWork;
 }