Test Connection

Add Todo
Bot use Webservice now
TBD : Rework Event
This commit is contained in:
2019-03-27 00:37:11 +01:00
parent 74327eb381
commit 63db02d798
25 changed files with 379 additions and 178 deletions

View File

@@ -0,0 +1,30 @@
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<Todo>, ITodoService
{
public TodoService(LaDOSEDbContext context) : base(context)
{
}
public override bool Delete(int id)
{
var find = _context.Find<Todo>(id);
find.Deleted = DateTime.Now;
this._context.SaveChanges();
return _context.Entry(find).State == EntityState.Modified;
}
public override IEnumerable<Todo> GetAll()
{
return _context.Set<Todo>().Where(e=>e.Deleted == null).ToList();
}
}
}