public void CreateVideoSlide(GalleryVideoLang model) { using (var db = new DataContext()) { var video = new GalleryVideo() { CreateDate = DateTime.Now }; db.GalleryVideos.Add(video); var videoRu = new GalleryVideoLanguage() { GalleryVideoId = video.Id, LanguageId = EnumLanguage.ru, Title = model.Ru_Title, Video = model.Ru_Video }; db.GalleryVideoLanguages.Add(videoRu); var videoRo = new GalleryVideoLanguage() { GalleryVideoId = video.Id, LanguageId = EnumLanguage.ro, Title = model.Ro_Title, Video = model.Ro_Video }; db.GalleryVideoLanguages.Add(videoRo); db.SaveChanges(); } }
public static ModelGalleryVideo ConvertToModelGalleryVideo(GalleryVideoLanguage model) { return(new ModelGalleryVideo() { Id = model.GalleryVideoId, CreateDate = model.GalleryVideo.CreateDate, Title = model.Title, Video = model.Video }); }