I just want that when the people include the created class in their projects, they can add another function to it but they can not change or remove the functions which is generated with the code generator
Unfortunately you can't do this, once you distribute code a developer has complete control over it. It's generally not recommended to modify generated code anyway, however, it can actually work to your advantage if your code contains a bug or is not compatible and needs to be tweaked.
The best approach would be to make your generated code class partial
which makes it much easier to extend e.g.
namespace My.Generated.Code
{
public partial class GeneratedClass
{
...
}
}
...
namespace Some.Other.Project
{
using My.Generated.Code;
public partial class GeneratedClass
{
public string NewProperty { get; set; }
public void NewMethod()
{
}
}
}
As long as you don't make any of the properties in your generated class virtual
then developers can add new behaviour/properties but can't modify existing.