hoeyi / Ozym

A web-application for tracking personal finances. Built using Blazor, ASP.NET Core, and Entity Framework Core.
3 stars 0 forks source link

AttributeMemberID is not properly set when working with AttributeDtoCollection classes #232

Closed hoeyi closed 1 year ago

hoeyi commented 1 year ago

Describe the bug

When trying to add attributes to the bank transaction code attribute collection, that operation fails due to the value of AttributeMember not being set, and consequently affecting the mapping of the value to the entity class for saving to the database.

To Reproduce Steps to reproduce the behavior:

  1. Go to /bank-transactions/{id}/edit.
  2. Add a new attribute to the record.
  3. At break point in ApiController.PutAsync, see added entry is mapped, but AttributeMemberID is default.

Expected behavior

The attribute collection helper objects should be setting the value of the attribute member, but there appears to be a gap since both the member AttributeMemberID and the complex member AttributeMember are used. Likely the problem is with an oversight from changing the worked objects to DTO classes instead of entity classes, which have a slightly different structure.

Desired solution

Might be better to rebuild the attribute collection helper objects entirely, since their overly complex and consequently tricky to test correctly.