I have read some about lambda. But I have problems with the code below, Who can explain to me?
public class FakeProductRepository : IProductRepository
{
public IEnumerable<Product> Products => new List<Product>
{
new Product { Name = "Football", Price = 25 },
new Product { Name = "Surf board", Price = 179 },
new Product { Name = "Running shoes", Price = 95 }
};
}
how public IEnumerable<Product> Products => new List<Product>
work??
Why when I use "=" instead of "=>" error occurs?:
Error CS0535 'FakeProductRepository' does not implement interface member 'IProductRepository.Products'