Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Concurrency mode: optimistic #33

Closed
ddewaleffe opened this issue Nov 6, 2018 · 3 comments
Closed

Concurrency mode: optimistic #33

ddewaleffe opened this issue Nov 6, 2018 · 3 comments
Labels
bug Confirmed bug released Issue is resolved in a current release

Comments

@ddewaleffe
Copy link

ddewaleffe commented Nov 6, 2018

Created a small model with Optimistic concurrency mode, using the default Timestamp as concurrency token property.
The generated code cannot be compiled due to generation of a line in several methods:

Timestamp = _timestamp;

where _timestamp is not declared at all, but it mentioned as parameter of the method in he documentation comment.

@msawczyn
Copy link
Owner

msawczyn commented Nov 6, 2018

Good catch! Seems two spots got missed in the text templates when doing the concurrency property fix. I'll get those pushed out in the next release, but in the interim you can do the following:

In EFDesigner.ttinclude, change lines 409 and 491 (same code in both places) from

   foreach (ModelAttribute requiredAttribute in modelClass.AllRequiredAttributes.Where(x => !x.IsIdentity && x.SetterVisibility == SetterAccessModifier.Public))

to

   foreach (ModelAttribute requiredAttribute in modelClass.AllRequiredAttributes.Where(x => !x.IsIdentity && !x.IsConcurrencyToken && x.SetterVisibility == SetterAccessModifier.Public))

That should fix it.

@msawczyn msawczyn added bug Confirmed bug workaround available There's a problem that needs fixed, but a procedure can currently be used to get the same result labels Nov 6, 2018
@msawczyn
Copy link
Owner

This is fixed in v1.2.6.18

@msawczyn msawczyn added released Issue is resolved in a current release and removed workaround available There's a problem that needs fixed, but a procedure can currently be used to get the same result labels Nov 27, 2018
@msawczyn
Copy link
Owner

Closing since fix is now released

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

2 participants