1

I have a AbstractTransformerCreationTask which seems to convert Ids to lowercase - even if I don't want that.

Say I have the following

public class EventProfileTransformer : AbstractTransformerCreationTask<EventInstance>
    {
        public EventProfileTransformer()
        {
            TransformResults = eventInstances => from ei in eventInstances
                                                 select new EventProfileDto
                                                 {
                                                     //lots of stuff going on here
                                                     EventInstance = new EventInstance{   Id = ei.Id }
                                                 };

         }
}

and it is called like:

Session.Query<EventInstance>().TransformWith<EventProfileTransformer, EventProfileDto>();

If I inspect this part: Session.Query<EventInstance>() - the Ids are OK - they are in camel case.

but if I inspect the whole line - so after it's been transformed - the Ids are lower case?

Why is this and how can I stop it? It obviously screws up Id comparison further down the line

1 Answers1

0

Create a static index for your query and define the index to store the Id property. Then it should return the correct casing after your transform.

Store(x => x.Id, FieldStorage.Yes);
Hallvar Helleseth
  • 1,867
  • 15
  • 17