Пример #1
0
        async Task <Guid> IPhoneCallService.HandleAsync(NewPhoneCall newPhoneCall)
        {
            var phoneCall = new PhoneCall {
                Customer   = Map <Customer>(newPhoneCall.CustomerInfo)
                , Operator = Operator
                , Products = Map <ProductRequest[]>(newPhoneCall.Products)
                , Support  = Map <SupportRequest[]>(newPhoneCall.Support)
            };
            var documentCollectionLink = UriFactory.CreateDocumentCollectionUri(ConfigurationManager.AppSettings["DocumentDbDatabaseName"], Collection());
            var response = await Client.CreateDocumentAsync(documentCollectionLink, phoneCall);

            return(Guid.Parse(response.Resource.Id));
        }
Пример #2
0
 public async Task Handle(NewPhoneCall newPhoneCall)
 {
     await Service.HandleAsync(newPhoneCall);
 }