Reputation: 3953
How to convert this C# 6.0 code to C# 4.0?
public void Subscribe(string message, Action<IMessagingService> callback) =>
MessagingCenter.Subscribe<MessagingService>(this, message, callback);
or
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture) => null;
Can I simply create get property?
Upvotes: 0
Views: 769
Reputation: 26836
This expression-bodied method you've shown is just C#6 shorthand for:
public void Subscribe(string message, Action<IMessagingService> callback)
{
MessagingCenter.Subscribe<MessagingService>(this, message, callback);
}
Upvotes: 5