示例#1
0
        public void Save(string auctionId, OfferJson json)
        {
            using (new OperationContextScope(InnerChannel))
            {
                var context = WebOperationContext.Current;
                Debug.Assert(context != null, "context != null");
                Session.GetInstance.ApplyHeaders(context.OutgoingRequest.Headers);

                Channel.Save(auctionId, json);
            }
        }
示例#2
0
        public void Save(string auctionId, OfferJson json)
        {
            if (!authorization.IsAuthorized())
            {
                throw new WebFaultException(HttpStatusCode.Unauthorized);
            }
            // TODO: walidacja

            Offer offer = json.ToOffer(auctionRepository);

            offer.Owner = userRepository.Find(authorization.UserId);

            offerRepository.Save(offer);
        }