Yep, brace always.

Because you will never know if you need to update your condition or chain another. The brace shows what is the scope of the condition, also for loops, for, for each, etc.

It is a good practices and it is more readable.

As Eduard Lebedyuk   has commented, a single IF for use to set a variable, the postconditionals is a good idea, coz you know the condition before to set.

The idea is to copy only the common properties.

If you see the definition of PersonalInfo and NameInfo, both are different classes.

The unique union between both classes is Kurro.Utils.Functions

He does not know what properties the target class obtained, he only knows his own properties and makes a list of methods to copy from the current class to the target class.

This method is compiled, therefore, you need to verify if the destination property exists in the target class at run time. This method is created "on fly" when you create a new instance of this class. Do you know if the property "Name" will be in the object passed as a parameter? Maybe not, so you should check if this property exists in the target.

makes sense?

I hope I have solved the doubt, or maybe I do not understand your question.

Hi,

I've created this method to check if a property exitsts because the method generator doesn't knows if the property exists in the target class in runtime.

If you debug the code you can see the compiled code:

zCopyProps(obj) public {
 If (obj.ExistsProperty("Code")) set obj.Code=..Code 
 If (obj.ExistsProperty("DateOfBirthday")) set obj.DateOfBirthday=..DateOfBirthday 
 If (obj.ExistsProperty("FirstName")) set obj.FirstName=..FirstName 
 If (obj.ExistsProperty("PassportId")) set obj.PassportId=..PassportId 
 If (obj.ExistsProperty("SecondName")) set obj.SecondName=..SecondName }

so, in runtime, there is no a quick way to check if this property exists to prevent an exception error.

Hi Eduard,

I tried to do that before, but all CSP pages was displayed, but WebApi didn't work. The problem has been resolved. Please check the other answer.

Thanks for your comment

Thanks Kyle,

You are right, Apache send all request to CSP Gateway, but IIS needs to know who to response the request. The answer is "*"

I've just done a "rubber duck" with myself... when I've wrote the comment, I've realised that the extensión that I have is "*.*", instead of "*", that is the difference.

A WebApi hasn't an extensión, therefore it is handler by the CSPms library.

I've just changed it and it works

Thanks for all

Hi Alexander,

I have the extension *.* to CSPms, instead of each extension (CSP, ZEN, CLS....) and the "Invoke handler only if request is mapped" is unchecked, but still doesn't work sad

Thanks John.

I've checked your answer as correct because this is the best approach to do it.

In Studio we can add everything and I don't forget any file.

Best regards,

Francisco López