Geeksltd / GCop

GCop packages
https://geeksltd.github.io/GCop/
24 stars 8 forks source link

GCop 411 #141

Open marjanjavid opened 6 years ago

marjanjavid commented 6 years ago

This rule is not kicked . as you can see in the picture, while Settings inherits GuidEntity, we do not have any warning in this line. 411

Foroughi commented 6 years ago

@PaymonK @Karvan I'm not sure what was the idea of this rule as some parts of the logic have been commented out and that's the reason Marjan couldn't find a good sample for this rule. So please let me know what should I do ?! Is it possible to recode the rule ?! Do you know guys why some parts are being commented out? or are you aware of the details of the logic of this rule?

Karvan commented 6 years ago

The commented code is not completely correct. Please recode it. the whole purpose of the rule:

while an object inherited IEntity, no need to set the Id manually. That's that.

Keep this line please: if (assignment.Right?.ToString() == "Guid.Empty") return;

Base class for MSharp object is GuidEntity which is coming from Entity, IEntity, IEntity, ICloneable, IComparable