public Decimal SaveProductFAQVideo(ProductFAQVideos productFAQVideo) { using (var context = new UniversityEntities()) { var productFaqVideo = context.ProductFAQVideos.FirstOrDefault(y => y.Id == productFAQVideo.Id && y.IsDeleted != true); if (productFaqVideo != null) { productFaqVideo.UpdatedDate = DateTime.UtcNow; if (!string.IsNullOrWhiteSpace(productFAQVideo.VideoURL)) { productFaqVideo.VideoURL = productFAQVideo.VideoURL; } if (!string.IsNullOrWhiteSpace(productFAQVideo.ImageURL)) { productFaqVideo.ImageURL = productFAQVideo.ImageURL; } context.SaveChanges(); return(productFaqVideo.Id); } else { //productFAQ.Id = Guid.NewGuid(); productFAQVideo.CreatedDate = DateTime.UtcNow; context.ProductFAQVideos.Add(productFAQVideo); context.SaveChanges(); return(productFAQVideo.Id); } } }
public Decimal SaveProductFAQVideo(ProductFAQVideos productFAQVideo) { return(_productRepository.SaveProductFAQVideo(productFAQVideo)); }