MapDataReader
MapDataReader copied to clipboard
Generation is broken when all class names are not unique
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.
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();