question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the bug Mapping from for example System.Numerics.Quaternion is broken. I get the feeling that this might be something that’s either not spelled out enough in the documentation or something that is an oversight because people mostly deal with Properties anyway. Anyway mapping from/to fields does not work. They are completely ignored. Which is a shame because I do tend to need such mapping from time to time and I currently have to do them manually.

To Reproduce

public class Quat
{
    public float X;
    public float Y;
    public float Z;
    public float W;
}

[Mapper]
public static partial class Map
{
    public static partial Quat ToQuat(Quaternion quaternion);
}

Generated code:

    public static partial class Map
    {
        public static partial ClassLibrary1.Quat ToQuat(System.Numerics.Quaternion quaternion)
        {
            var target = new ClassLibrary1.Quat();
            return target;
        }
    }

Environment (please complete the following information):

  • Mapperly Version: 2.6.0
  • .NET Version: 7
  • Target Framework: 7
  • OS: Linux

Additional context

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
latonzcommented, Apr 17, 2023

On a second thought and after reading @Blackclaws’s comment I think enabling field mappings by default should be fine and even expected by most of users. #346 adds support for fields. Field mappings are enabled by default and the only currently implemented way to disable them is by using MapperIgnoreTarget / MapperIgnoreSource. A next release should be published in the upcoming days including this feature.

0reactions
softlioncommented, Apr 17, 2023

A lot of devs expect consistent behaviors between different .NET features. So having a feature that behaves like Fody.PropertyChanged or System.Text.Json makes more sense in my vision of things.

The new “record” type for example is a compact syntax to create a class or struct with only properties.

I understand what you mean with mapping those structs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support fields
This module is an add-on to the Support Ticketing system module. It allows an administrator to define custom cck fields to the STS...
Read more >
About ticket fields
Standard ticket fields are the predefined fields that agents see in a ticket. · Custom ticket fields can be created in addition to...
Read more >
Adding custom fields to your tickets and support request form
Custom ticket fields are typically used to gather more information about the support issue or product or service. You can add custom fields...
Read more >
Support Fields
Support Fields helps to organize support tickets. The plugin allows to create forms the customer needs to go through before submitting a ...
Read more >
Configure issue custom fields
Jira application issues are made up of fields. You can choose any number of fields to appear when creating, editing, or transitioning issues....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found