public Favourite Add(Favourite favourite) { var e = new FavouriteEventArgs { Favourite = favourite }; EventManager.Instance.FireBeforeFavourite(this, e); if (!e.Cancel) { favourite = _context.Favourite.Add(favourite); EventManager.Instance.FireAfterFavourite(this, new FavouriteEventArgs { Favourite = favourite}); } return favourite; }
public Favourite Add(Favourite favourite) { var e = new FavouriteEventArgs { Favourite = favourite }; EventManager.Instance.FireBeforeFavourite(this, e); if (!e.Cancel) { favourite = _context.Favourite.Add(favourite); EventManager.Instance.FireAfterFavourite(this, new FavouriteEventArgs { Favourite = favourite }); } return(favourite); }