public BookDomain Update(BookDomain book) { var bookEntity = Map(book); dbContext.Books.ReplaceOne(Builders <Book> .Filter.Eq(s => s.Id, book.Id), bookEntity); return(Map(bookEntity)); }
public BookDomain Add(BookDomain book) { var bookEntity = Map(book); dbContext.Books.InsertOne(bookEntity); return(Map(bookEntity)); }
private Book Map(BookDomain book) { return(new Book() { Id = book.Id, Title = book.Title, Author = book.Author, Path = book.Path, Status = book.Status.ToString() }); }
public void Update(Guid id, BookDomain bookIn) => dbContext.Books.ReplaceOne(book => book.Id == id, Map(bookIn));