public void AddExtraKeys(List <ExtraProductKey> keys) { if (keys != null && keys.Count > 0) { ExtraKeys.AddRange(keys); } }
public Product(ProductEntity entity) : this() { if (entity == null) { return; } Key = entity.Key; Name = entity.Name; DateAdded = entity.DateAdded; if (entity.ExtraKeys != null && entity.ExtraKeys.Count > 0) { ExtraKeys.AddRange(entity.ExtraKeys.Select(e => new ExtraProductKey(e))); } }