linq2db / docs

Documentation sources and build scripts
2 stars 10 forks source link

Create wiki article about mappings configuration and how to support mappings from other ORM/custom mapping sources #18

Open MaceWindu opened 7 years ago

max-arshinov commented 6 years ago

Hi. Is there a way to avoid using [Table] and [Column] attributes? I am wondering if I can use same POCO classes with EF and linq 2 db. A lot of code is written with EF. If I can reuse it's mapping I can refactor code from EF to linq 2 db step by step.

sdanyliv commented 6 years ago

Yes, check this discussion thread https://github.com/linq2db/linq2db/issues/900

max-arshinov commented 6 years ago

Thank you. So to support Data Annotation Attributes I need to create MappingSchema and then use reflection to build entity mappings using GetFluentMappingBuilder().Entity<>..., right?

sdanyliv commented 6 years ago

Not exactly, based on discussion thread you can convert current attributes to our attributes. But yes you need to define mapping schema, for example in DataConnection constructor.

MaceWindu commented 5 years ago

Closing for now...