public IActionResult AddTodo([FromBody] CreateTodoReq req) { var claims = User.Identity as ClaimsIdentity; var data = claims.Claims; var id = int.Parse(data.First(s => s.Type == ClaimTypes.NameIdentifier).Value); _toDoService.AddTodo(id, req.Title); return(Ok()); }
public int CreateTodo(CreateTodoReq request) { try { DynamicParameters parameters = new DynamicParameters(); parameters.Add("@TaskName", request.TaskName); parameters.Add("@Important", request.Important); parameters.Add("@GroupIDG", request.GroupIDG); parameters.Add("@Progress", request.Progress); var id = SqlMapper.ExecuteScalar <int>(con, "CreateTodo", param: parameters, commandType: CommandType.StoredProcedure); return(id); } catch (Exception ex) { //throw ex; return(0); } }
public int CreateTodo([FromBody] CreateTodoReq request) { return(_todoService.CreateTodo(request)); }
public int CreateTodo(CreateTodoReq request) { return(_todoRepository.CreateTodo(request)); }