dennisdoomen wrote:
Yes
I wrote:
With List<Product> don't working :( May can used List<T> ?
And second question:
How can exclude property Status from class Product for all elements of array?
Thanks.
I think using an Expression with an indexer only works if the collection is an array. You should use the overload that takes a Func<ISubjectInfo, bool>() to compare the property path against "Products[0].Status".Big Thanks!!!
Yes
I wrote:
public class Order
{
public Int32 Id { get; set; }
public Product[] Products { get; set; }
}
~~~~~~~
[Test]
~~~
order2.ShouldBeEquivalentTo(order1, options => options.Excluding(o => o.Products[0].Status).Excluding(o => o.Products[1].Status));
And test is success.With List<Product> don't working :( May can used List<T> ?
private List<Product> _product;
public Product[] Products
{
get{ return _product.ToArray(); }
}
is bad option.And second question:
How can exclude property Status from class Product for all elements of array?
Thanks.