Skip to content

Commit

Permalink
Correct Name
Browse files Browse the repository at this point in the history
  • Loading branch information
sguming committed Aug 12, 2024
1 parent 0068e6e commit 0f88e10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blotztask-api/Models/TaskItemDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class TaskItemDTO
{
public int Id { get; set; }
public int ID { get; set; }
public string Title { get; set; }

Check warning on line 6 in blotztask-api/Models/TaskItemDTO.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

Non-nullable property 'Title' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 6 in blotztask-api/Models/TaskItemDTO.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

Non-nullable property 'Title' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public string Description { get; set; }

Check warning on line 7 in blotztask-api/Models/TaskItemDTO.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 7 in blotztask-api/Models/TaskItemDTO.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public bool IsDone { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions blotztask-api/Services/TaskService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public async Task<List<TaskItemDTO>> GetTodoItems()
return await _dbContext.TaskItems
.Select(x => new TaskItemDTO
{
Id = x.Id,
ID = x.ID,

Check failure on line 29 in blotztask-api/Services/TaskService.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

'TaskItem' does not contain a definition for 'ID' and no accessible extension method 'ID' accepting a first argument of type 'TaskItem' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 29 in blotztask-api/Services/TaskService.cs

View workflow job for this annotation

GitHub Actions / build-and-test-backend

'TaskItem' does not contain a definition for 'ID' and no accessible extension method 'ID' accepting a first argument of type 'TaskItem' could be found (are you missing a using directive or an assembly reference?)
Title = x.Title
})
.ToListAsync();
Expand All @@ -42,9 +42,9 @@ public async Task<TaskItemDTO> GetTaskByID(int ID)

var taskItems = new List<TaskItemDTO>
{
new TaskItemDTO { Id = 0, Title = "Task 0", Description = "Description for Task 1", IsDone = false, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now },
new TaskItemDTO { Id = 1, Title = "Task 1", Description = "Description for Task 2", IsDone = true, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now },
new TaskItemDTO { Id = 2, Title = "Task 2", Description = "Description for Task 3", IsDone = false, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now }
new TaskItemDTO { ID = 0, Title = "Task 0", Description = "Description for Task 1", IsDone = false, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now },
new TaskItemDTO { ID = 1, Title = "Task 1", Description = "Description for Task 2", IsDone = true, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now },
new TaskItemDTO { ID = 2, Title = "Task 2", Description = "Description for Task 3", IsDone = false, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now }
};

return await Task.FromResult(taskItems[ID]);
Expand Down

0 comments on commit 0f88e10

Please sign in to comment.