Hi guys,
Are you aware that field names conflict with property names when automapping columns? So a class written like:
public class Customer
{
private int
id;
public int ID
{
get { return id; }
set { id = value; }
}
}
... will cause iBATIS.NET to fail with:
CustomerRepositoryTest.ShouldGetCustomerByID : IBatisNet.DataMapper.Exceptions.DataMapperException
: Error automapping columns. Cause: Item has already been added. Key in dictionary: 'ID' Key being added: 'ID'
----> System.ArgumentException : Item has already been added. Key in dictionary: 'ID' Key being added: 'ID'
Seems like we're using the same map for fields and properties. I suppose the solution is to not. :-)
I think we should probably have two maps, one for fields, one for properties and then make a decision like: "properties always take precidence over fields if both exist" (favouring encapsulation).
Thoughts?
Clinton
- Field names conflict with Property names when automapping Clinton Begin
- Re: Field names conflict with Property names when autom... Gilles Bayon
- Re: Field names conflict with Property names when a... Clinton Begin
- Re: Field names conflict with Property names wh... Gilles Bayon
- Re: Field names conflict with Property names when a... Bob Hanson
- Re: Field names conflict with Property names wh... Bob Hanson
- Remove me Eva Li
- Re: Field names conflict with Property names when autom... Gilles Bayon

