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

Generation is broken when all class names are not unique #5

Open
ronnieoverby opened this issue Apr 5, 2024 · 1 comment
Open

Generation is broken when all class names are not unique #5

ronnieoverby opened this issue Apr 5, 2024 · 1 comment

Comments

@ronnieoverby
Copy link

I use a code generator to generate classes to represent my sql schema.

The generator generates code like this:

namespace dbo // schema name
{
    partial class Customers // table name
    {
           partial class RowData
           {
               // property for each column
           }
          
    } 

    partial class Orders// table name
    {
           partial class RowData
           {
               // property for each column
           }
          
    } 
}

In another file I put your attribute on my RowData types:

    [GenerateDataReaderMapper]
    public partial class RowData;

But since I have multiple types with the same name, your generator fails to do anything.

@ShawnTheBeachy
Copy link

Same issue here. Would be great to be able to specify either a namespace or a custom extension method name. Preferably both.

Namespace

[GenerateDataReaderMapper(NameSpace = "MyProject.Customers")]
public sealed class Customer;
[GenerateDataReaderMapper(NameSpace = "MyProject.Orders")]
public sealed class Customer;

Method name

[GenerateDataReaderMapper(MethodName = "ToCustomer")]
public sealed class Customer;

...

reader.ToCustomer();
[GenerateDataReaderMapper(MethodName = "ToOrderCustomer")]
public sealed class Customer;

...

reader.ToOrderCustomer();

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

No branches or pull requests

2 participants