Skip to content

Commit dff608d

Browse files
committed
Implement querying publications
The code was already there, this commit just moves it around so it's next to the other publication-related methods, to find it easier.
1 parent ffd4b9e commit dff608d

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,11 @@ public IAsyncEnumerable<PartOfSpeech> GetPartsOfSpeech()
155155
return PartsOfSpeech.AsAsyncEnumerable();
156156
}
157157

158-
public IAsyncEnumerable<Publication> GetPublications()
159-
{
160-
return Publications.AsAsyncEnumerable();
161-
}
162-
163158
public async Task<PartOfSpeech?> GetPartOfSpeech(Guid id)
164159
{
165160
return await PartsOfSpeech.SingleOrDefaultAsync(pos => pos.Id == id);
166161
}
167162

168-
public async Task<Publication?> GetPublication(Guid id)
169-
{
170-
return await Publications.SingleOrDefaultAsync(p => p.Id == id);
171-
}
172-
173163
public async Task<PartOfSpeech> CreatePartOfSpeech(PartOfSpeech partOfSpeech)
174164
{
175165
if (partOfSpeech.Id == Guid.Empty) partOfSpeech.Id = Guid.NewGuid();
@@ -199,6 +189,16 @@ public async Task DeletePartOfSpeech(Guid id)
199189
await AddChange(new DeleteChange<PartOfSpeech>(id));
200190
}
201191

192+
public IAsyncEnumerable<Publication> GetPublications()
193+
{
194+
return Publications.AsAsyncEnumerable();
195+
}
196+
197+
public async Task<Publication?> GetPublication(Guid id)
198+
{
199+
return await Publications.SingleOrDefaultAsync(p => p.Id == id);
200+
}
201+
202202
public async Task<Publication> CreatePublication(Publication pub)
203203
{
204204
await AddChange(new CreatePublicationChange(pub.Id, pub.Name));

0 commit comments

Comments
 (0)