This is good advice, but it will not help you find out exactly where the right place for such a function ...
Is there any guidance on DECOMPOSING EF.tt files or step-by-step through the output view to see how it creates the output?
I was able to successfully use this function by connecting it to a function called (Ef4.3)
public string Property (EdmProperty edmProperty)
It seems to be used to output strings like "public int fieldname {get; set;}"
and changed parameter 3 (index {2}) to form in order to wrap the function for changing the name, for example:
_typeMapper.GetTypeName(edmProperty.TypeUsage), //unchanged UnderScoreToPascalCase(_code.Escape(edmProperty)), //wrapped "name" _code.SpaceAfter(Accessibility.ForGetter(edmProperty)), // unchanged
This is not ideal, for example: it does not preserve the existing "Ucasing" and does not care about such things: customerIP outputs: Customerip that IMO is not very readable ...
but itβs better than I looked at what was a nightmare because the database was mixed with camelCase, PascalCase mess and underline separation, so itβs pretty terrible.
In any case, this will help someone ...
source share