예제 #1
0
        public Task GetTask(int id)
        {
            Task task = null;

            lock (_lock)
            {
                task = _tasks.FirstOrDefault(t => t.Id == id);
            }

            return(task);
        }
예제 #2
0
 public async Task <bool> UpdateTaskAsync(Task task)
 {
     using (var context = _unitOfWork.Create())
     {
         try
         {
             return(await context.Attach(task).Update(task).CommitAsync().ConfigureAwait(false));
         }
         catch (Exception ex)
         {
             _logger.Error(ex);
             return(false);
         }
     }
 }