This is a migrated thread and some comments may be shown as answers.

[Solved] Auto Mapping

1 Answer 115 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Panji
Top achievements
Rank 1
Panji asked on 05 Nov 2010, 11:48 PM
Hi All. I saw OA has fluent interface. Does it have (or planned to have) auto mapping as well, similar to FluentNH Auto Mapping (http://wiki.fluentnhibernate.org/Auto_mapping) ?

Regards,
Panji

1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 11 Nov 2010, 10:44 AM
Hello Panji,

 We do provide a similar feature yes, however we refer to it as DefaultMapping. And while it is not as easy as saying default map assembly it is still pretty useful. I have attached a simple project that you can use as a starting point. From here on you can easily provide default mappings for your classes. You should add these lines of code in the PrepareMapping override of the MyFluentMetadataSource for each class you want to map.

MappingConfiguration<YourClass> yourClassConfiguration = new MappingConfiguration<YourClass>();
yourClassConfiguration.MapType();
yourClassConfiguration.HasProperty(x => x.MyIdProperty).IsIdentity();
list.Add(yourClassConfiguration);

While it seems a little more than NHibernate's auto mapping it is pretty straight forward and we believe it should be this way. I would like to point out that we are currently upgrading our on-line help and we have provided extensive help article for the Fluent Mapping API. You could have a read at the documentation that is installed on your machine, you will be happy to find a whole chapter dedicated to the Default Mapping.

I hope this is helpful and we will like to hear more from you on the topic of Fluent Mapping. It is a work in progress and we will be glad to you and suggestions you might have.


Best wishes,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Panji
Top achievements
Rank 1
Answers by
Serge
Telerik team
Share this question
or