using ConstructorApp.DataAccessLayer.Abstract; using ConstructorApp.DataAccessLayer.Concrete; using ConstructorApp.DataAccessLayer.Repositories; using ConstructorApp.EntityLayer.Entities; namespace ConstructorApp.DataAccessLayer.EntityFramework { public class EfTestimonialDal : GenericRepository, ITestimonialDal { private readonly ConstructorContext context; public EfTestimonialDal(ConstructorContext context) : base(context) { this.context = context; } public int CountAll() { return context.Testimonials.Count(x => x.Status != TestimonialStatus.Cancelled); } public void TestimonialStatusActive(int id) { var values = context.Testimonials.Find(id); values.Status = TestimonialStatus.Confirmed; context.SaveChanges(); } public void TestimonialStatusPassive(int id) { var values = context.Testimonials.Find(id); values.Status = TestimonialStatus.Cancelled; context.SaveChanges(); } } }