July 2019
Intermediate to advanced
410 pages
10h 32m
English
As an example, let's revisit the InventoryContext class that is used to manage the inventory of books, by segregating the read and the write operations performed on our collection of books. IInventoryContext is split into IInventoryReadContext and IInventoryWriteContext:
using FlixOne.InventoryManagement.Models;namespace FlixOne.InventoryManagement.Repository{ public interface IInventoryContext : IInventoryReadContext, IInventoryWriteContext { } public interface IInventoryReadContext { Book[] GetBooks(); } public interface IInventoryWriteContext { bool AddBook(string name); bool UpdateQuantity(string name, int quantity); }}
Read now
Unlock full access