/// <summary> /// Updates asynchronously the specified expense. /// </summary> /// <param name="entity">The expense to update.</param> /// <returns>Instance of <see cref="JsonExpense"/> class with modified entity.</returns> /// <exception cref="ArgumentNullException">entity</exception> public async Task <JsonExpense> UpdateAsync(JsonExpense entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } return(await base.UpdateSingleEntityAsync(string.Format(EntityPath, entity.id), entity)); }
/// <summary> /// Creates asynchronously the specified new expense. /// </summary> /// <param name="entity">The new expense.</param> /// <returns>ID of newly created expense.</returns> /// <exception cref="ArgumentNullException">entity</exception> public async Task <int> CreateAsync(JsonExpense entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } return(await base.CreateEntityAsync(CollectionPath, entity)); }
/// <summary> /// Updates the specified expense. /// </summary> /// <param name="entity">The expense to update.</param> /// <returns>Instance of <see cref="JsonExpense"/> class with modified entity.</returns> /// <exception cref="ArgumentNullException">entity</exception> public JsonExpense Update(JsonExpense entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } return(base.UpdateSingleEntity(string.Format(EntityPath, entity.id), entity)); }
/// <summary> /// Creates the specified new expense. /// </summary> /// <param name="entity">The new expense.</param> /// <returns>ID of newly created expense.</returns> /// <exception cref="ArgumentNullException">entity</exception> public int Create(JsonExpense entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } return(base.CreateEntity(CollectionPath, entity)); }