DocumentDBRepository.UpdateItemAsync C# (CSharp) Метод

UpdateItemAsync() публичный статический Метод

public static UpdateItemAsync ( string id, item ) : Task
id string
Результат Task
        public static async Task<Document> UpdateItemAsync(string id, T item)
        {
            return await client.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(DatabaseId, CollectionId, id), item);
        }
        public static async Task DeleteItemAsync(string id)

Usage Example

Пример #1
0
        private static async Task SaveExpanseAndUpdateEmployee(IDialogContext context, string profileKey, ExpenseReport expenseReport)
        {
            await DocumentDBRepository.CreateItemAsync <ExpenseReport>(expenseReport);

            Employee employee = context.ConversationData.GetValue <Employee>(profileKey);

            if (employee.ExpenseReportList == null)
            {
                employee.ExpenseReportList = new List <string>()
                {
                    expenseReport.Id
                };
            }
            else
            {
                employee.ExpenseReportList.Add(expenseReport.Id);
            }

            await DocumentDBRepository.UpdateItemAsync <Employee>(employee.EmailId, employee);

            context.ConversationData.SetValue(profileKey, employee);
        }
All Usage Examples Of DocumentDBRepository::UpdateItemAsync