public async Task AddHistory(CreateHistoryCommand command) { await this.Add(new BookHistory { BookId = command.BookId, Created = command.Created, Type = command.Type }); }
public async Task <IHttpActionResult> Delete(int id) { var command = new CreateHistoryCommand { BookId = id, Type = BookHistoryType.Deleted, Created = DateTime.Now }; return(await this.Try(() => this._bookHistoryRepository.AddHistory(command))); }