Test Connection
Add Todo Bot use Webservice now TBD : Rework Event
This commit is contained in:
30
LaDOSE.Src/LaDOSE.Service/Service/TodoService.cs
Normal file
30
LaDOSE.Src/LaDOSE.Service/Service/TodoService.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ChallongeCSharpDriver;
|
||||
using ChallongeCSharpDriver.Core.Queries;
|
||||
using ChallongeCSharpDriver.Core.Results;
|
||||
using LaDOSE.Business.Helper;
|
||||
using LaDOSE.Business.Interface;
|
||||
using LaDOSE.Entity;
|
||||
@@ -154,6 +159,12 @@ namespace LaDOSE.Business.Service
|
||||
return "error while creating challonge";
|
||||
}
|
||||
|
||||
public async Task<string> GetLastChallonge()
|
||||
{
|
||||
var lastTournament = await _challongeProvider.GetLastTournament();
|
||||
return lastTournament;
|
||||
}
|
||||
|
||||
private string FormatCurrentEventName(string currentEventName)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user