-3

The code below is used to initialise a store in some C# code I am looking at. However I do not understand the => syntax in this context.

Any ideas?

protected new ServiceRepositoryStore<T> Store => (ServiceRepositoryStore<T>) base.Store;
AJM
  • 32,054
  • 48
  • 155
  • 243

1 Answers1

6

That is an example of an expression bodied read-only property:

https://msdn.microsoft.com/en-us/magazine/dn802602.aspx

It's a C# 6.0 feature and is the equivalent of:

protected new ServiceRepositoryStore<T> Store
{
    get
    {
        return (ServiceRepositoryStore<T>) base.Store;
    }
}
Justin Niessner
  • 242,243
  • 40
  • 408
  • 536