Skip to content

Conversation

@Fr-Soltanzadeh
Copy link
Contributor

@Fr-Soltanzadeh Fr-Soltanzadeh commented Mar 5, 2024

  • Fix GetById bug
  • Fix GetAll bug

@Fr-Soltanzadeh Fr-Soltanzadeh changed the title Resolve bugs Fix create index bug. Mar 11, 2024
{
T? entity = dbCollection.FindById(str_id);
if (entity == null)
T DefaultEntity = JsonSerializer.Deserialize<T>("{}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this logic is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As FindById(str_id) does not return null in case of inexistence of object and it returns a default object, I created a new default object ( JsonSerializer.Deserialize("{}");) and checked if two objects are equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants