andrebaltieri / Flunt

Validations and Notifications
https://github.com/andrebaltieri/flunt
MIT License
624 stars 162 forks source link

Added support for type on Notification #54

Closed andrebaltieri closed 3 years ago

andrebaltieri commented 3 years ago

Add a new method to add notifications by passing its type and message.

public void AddNotification(Type property, string message)
{
    _notifications.Add(new Notification(property?.Name, message));
}

How to use

AddNotification(typeof(Name), "Message");
andrebaltieri commented 3 years ago

Done https://github.com/andrebaltieri/Flunt/blob/dev/Flunt/Notifications/Notifiable.cs