Skip to content

Commit a4e5f37

Browse files
committed
Resolve accessiblity issues. And implement a mock Add method.
1 parent f091658 commit a4e5f37

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/Core/Domain/Services/ICategoryRepository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public interface ICategoryRepository
99
ICategory Get(Guid id);
1010
ICategory GetByName(string name);
1111
IList<ICategory> GetAll();
12-
ICategory Add<ICategory>(ICategory category);
13-
ICategory Save<ICategory>(ICategory category);
12+
ICategory Add(ICategory category);
13+
ICategory Save(ICategory category);
1414
ICategory Delete(Guid id);
1515
}
1616
}

src/Infrastructure.Data.MongoDb/CategoryRepository.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@ namespace CompanyName.Notebook.NoteTaking.Infrastructure.Data.MongoDb
77

88
public class CategoryRepository : ICategoryRepository
99
{
10-
public ICategory Add<ICategory>(ICategory category)
10+
public ICategory Add(ICategory category)
1111
{
12-
throw new NotImplementedException();
12+
var newCategory = new Category()
13+
{
14+
Id = Guid.NewGuid(),
15+
Name = category.Name,
16+
Created = category.Created,
17+
Notes = new List<INote>(category.Notes),
18+
Subscribers = new List<ISubscriber>(category.Subscribers)
19+
};
20+
Console.WriteLine($"Add new Category\n${newCategory}");
21+
return newCategory;
1322
}
1423

1524
public ICategory Delete(Guid id)
@@ -32,7 +41,7 @@ public ICategory GetByName(string name)
3241
throw new NotImplementedException();
3342
}
3443

35-
public ICategory Save<ICategory>(ICategory category)
44+
public ICategory Save(ICategory category)
3645
{
3746
throw new NotImplementedException();
3847
}

0 commit comments

Comments
 (0)