Answer the question
In order to leave comments, you need to log in
How to properly handle non-IEntity data?
How do you usually implement classes for data received via api , but not being an Entity.
Well, that is, for example, a certain method. There is a news entity and a news service, but using it I get, let’s say, just some data that does not have an ID, which means it’s not an entity, so I can no longer implement the IEntity interface for it, and also use NewsApiRepository aka to get it. What to do with such data?
public async Task<IList<NewsSentimentIndexes>> getNewsSentimentIndexes(NewsRequest request)
{
var res = await _client.getList<NewsSentimentIndexes>(request);
return res.Value;
}
Answer the question
In order to leave comments, you need to log in
GLEB GLEBOV : In your question, you threw out a bunch of the internal context of the project, which we don’t even know about. Some kind of NewsApiRepository aka, some kind of IEntity (no, we know what Entity is, but we have no idea how IEntity works for you).
I had to read it several times to figure it out.
To work with non-IEntity data, make a non-IEntity repository.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question