Пример #1
0
        public void AddStoryArtist(ObservableChangedCollection <StoryArtistEditModel> storyArtists, int?storyId)
        {
            if (storyId.HasValue)
            {
                if (!StoryArtist.Any(s => s.StoryId == storyId.Value))
                {
                    if (!storyArtists.Any(s => s.StoryId == storyId.Value))
                    {
                        StoryArtist.Add(new StoryArtistEditModel
                        {
                            ArtistId = Id,
                            StoryId  = storyId
                        });
                    }

                    StoryArtist = storyArtists;
                }
            }
        }