/// <summary> /// Updates the entity with the values contained within the surrogate. /// </summary> /// <param name="entity">The entity.</param> public void BindObjectInstance(Inventory entity) { if (entity.Row.RowState == DataRowState.Added) { entity.ProductID = ProductID; entity.StockOnHand = StockOnHand; } else { if (_productidHasBeenUpdated) { entity.ProductID = ProductID; } if (_stockonhandHasBeenUpdated) { entity.StockOnHand = StockOnHand; } } }
/// <summary>Constructor for assembling a surrogate from an entity object.</summary> /// <param name="entity">The Entity Object.</param> public InventorySurrogate(Inventory entity) : base(entity) { _sb = new StringBuilder(); }
/// <summary> /// Initializes a new instance of the <see cref="InventorySurrogateBase"/> class. /// </summary> /// <param name="entity">The entity.</param> public InventorySurrogateBase(Inventory entity) { InventoryID = entity.InventoryID; ProductID = entity.ProductID; StockOnHand = entity.StockOnHand; }