protected override void PreSave(Card card) { if (!card.CardType.Id.HasValue) { CardTypeDataAccess.Save(card.CardType); } if (card.PrimaryImage != null) { ImageDataAccess.Save(card.PrimaryImage); } }
protected override void PostSave(Card card) { foreach (var link in card.HardLinks) { HardLinkDataAccess.Save(link); } foreach (var link in card.ReferencedBy) { HardLinkDataAccess.Save(link); } foreach (var image in card.AdditionalImages) { ImageDataAccess.SaveImageToCard(image, card); } }