using System; using System.Collections.Generic; using System.Linq; using LaDOSE.Business.Interface; using LaDOSE.Entity; using LaDOSE.Entity.Context; using Microsoft.EntityFrameworkCore; namespace LaDOSE.Business.Service { public class TodoService : BaseService, ITodoService { public TodoService(LaDOSEDbContext context) : base(context) { } public override bool Delete(int id) { var find = _context.Find(id); find.Deleted = DateTime.Now; this._context.SaveChanges(); return _context.Entry(find).State == EntityState.Modified; } public override IEnumerable GetAll() { return _context.Set().Where(e=>e.Deleted == null).ToList(); } } }