Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in example code #17692

Closed
CeciAc opened this issue Apr 9, 2020 · 3 comments
Closed

Error in example code #17692

CeciAc opened this issue Apr 9, 2020 · 3 comments
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue ⌚ Not Triaged

Comments

@CeciAc
Copy link

CeciAc commented Apr 9, 2020

The comments below were machine-translated

@Maximys commented on Thu Apr 09 2020

The Update method (string id, Book bookIn) contains an error - we in bookIn do not fill in the Id property, and therefore ReplaceOne will throw an exception. It should be something like this:
public async void Update(string id, Book bookIn)
{
bookIn.Id = id;//фикс ошибки.
await Books.ReplaceOneAsync(b => b.Id == id, bookIn);
}


Сведения о документе

Не вносите правки в этот раздел. Это необходимо для связывания страницы сайта docs.microsoft.com с вопросом на GitHub.


@srvbpigh commented on Thu Apr 09 2020

Hello, @Maximys

Thank you for your feedback.

We are actively reviewing your comments and will get back to you soon.

Kind regards,
Microsoft DOCS International Team

@dotnet-bot dotnet-bot added ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels Apr 9, 2020
@CeciAc CeciAc changed the title Ошибка в коде примера Error in example code Apr 9, 2020
@Maximys
Copy link

Maximys commented Apr 9, 2020

May be my repository will helpful for understanding what's wrong: https://bitbucket.org/Mixim/e-learning/src/master/Src/NoSQL/BooksApi/BooksApi/Services/BookService.cs

@Rick-Anderson
Copy link
Contributor

Moved to Master list: Create a web API and MongoDB #16196

@serpent5
Copy link
Contributor

Fixed in #24126.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source - Docs.ms Docs Customer feedback via GitHub Issue ⌚ Not Triaged
Projects
None yet
Development

No branches or pull requests

5 participants