using DatabaseEditor.BL.Models;
using DatabaseEditor.Messages;

namespace DatabaseEditor.ViewModels
{
    public class EditBookViewModel : EditItemViewModel<BookDetailModel, AuthorListModel>
    {
        protected override void AddItem(AddItemMessage<AuthorListModel> message)
        {
            var item = message.Item;
            if (item == null) return;

            ItemDetail.Authors.Add(item);
        }

        protected override void RemoveItem(AuthorListModel item)
        {
            ItemDetail.Authors.Remove(item);
        }
    }
}
