'Field in plugin don't change

I have a plugin post operation, that has one input entity (entity1), and creates entity2. In entity1 there is a field1, and I record it to the entity2 field2. All fields successfully are transferred except field2

plugin{
var entity2= new Entity2(){
...
field2=entity1.field1
}
...
localContext.PluginExecutionContext.OutputParameters["Entity2"] = entity2.ToEntityReference();
}

I debug and field2 presents in entity2 with a value during plugin, but plugin returns entity2 with an empty field2.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source