jordimontana82 / fake-xrm-easy

The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
https://dynamicsvalue.com/get-started/overview?source=git
Other
263 stars 182 forks source link

RowVersion property is not supported #553

Open TheRe4lOne opened 3 years ago

TheRe4lOne commented 3 years ago

It seems like the RowVersion field is not used when an entity is being added during the Initialize method. For example: I have created an entity in my test with a RowVersion = "123" field. Used the context Initialize method and passed as a parameter the entity I have just created. In my plugin I have a code that retrieves this entity and doing something with the RowVersion field. Apparently, when you retrieve this entity, the RowVersion is always null.

It seems like that the method Clone(this Entity e, Type t, XrmFakedContext context = null) in EntityExtensions.cs does not populate the RowVersion field but only the Id and Logical Name.

Just wanted to know if it is a bug or is there another way to get this field?

this is the part where I think the RowVersion is missing. var cloned = Activator.CreateInstance(t) as Entity; cloned.Id = e.Id; cloned.LogicalName = e.LogicalName;

jordimontana82 commented 3 years ago

Thanks for spotting this. There was no appetite in the community for a RowVersion property up until now apparently :D so yeah, the RowVersion cloning hasn't been there yet. I'll add it to the backlog.