/// <summary> /// Updates the entity with the values contained within the surrogate. /// </summary> /// <param name="entity">The entity.</param> public void BindObjectInstance(Product entity) { if (entity.Row.RowState == DataRowState.Added) { entity.Description = Description; entity.Supplier = Supplier; } else { if (_descriptionHasBeenUpdated) { entity.Description = Description; } if (_supplierHasBeenUpdated) { entity.Supplier = Supplier; } } }
/// <summary>Constructor for assembling a surrogate from an entity object.</summary> /// <param name="entity">The Entity Object.</param> public ProductSurrogate(Product entity) : base(entity) { _sb = new StringBuilder(); }
/// <summary> /// Initializes a new instance of the <see cref="ProductSurrogateBase"/> class. /// </summary> /// <param name="entity">The entity.</param> public ProductSurrogateBase(Product entity) { ProductID = entity.ProductID; Description = entity.Description; Supplier = entity.Supplier; }