Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output to designer.cs #412

Closed
VanHinthem opened this issue May 4, 2023 · 3 comments
Closed

Output to designer.cs #412

VanHinthem opened this issue May 4, 2023 · 3 comments

Comments

@VanHinthem
Copy link

Tool
What tool/version is it that you're making a feature request for? i.e.
EarlyBoundGenerator

Describe the solution you'd like
Would it be possible to create an option where the EarlyBoundGenerator would write the output to designer.cs files ?

@daryllabar
Copy link
Owner

What is outputting it to a designer.cs file do? Is that just trying to output it to a single file with that name, or is there more to it?

@VanHinthem
Copy link
Author

VanHinthem commented May 4, 2023

You get an output like:

File:

Account.designer.cs

namespace example
{

public partial class Account : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
{
          etc...
}

}

And the Account.cs

namespace exmaple
{
public partial class Account
{
}
}

When generating check if account.cs exists, if not create it. In this way you get a separation of code generation and custom extensions and methods ...

@daryllabar
Copy link
Owner

So this is a trick in the project file itself, where it describes the files as nested. You can manually do this yourself, or, (what I do) just create another folder called "Partials" and put your custom code in there. Just make sure the namespace is the same, and the partial classes will get combined at compile time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants