简体   繁体   中英

How can I map my entity to a table in .Net Core project without using Entity Framework and only using ADO.NET

I have a project for Entities and I am using ADO.NET code for normal CRUD operations on this entity. I would like to map my entity name to table names, Could you please provide me a way to do it. With .Net Standard I could use System.Data.Linq.Mapping. But my project is in .Net Core 2.2 and I cannot add these as a reference, tried changing target framework, but my other projects are not compatible. Kindly advise me how do I do it.

I can see a couple of options.

1) Create a Mapper class that accepts T1 & T2.. And do the mapping manually for each property.

2) Use a library such as Automapper that does all this for you automatically ( https://github.com/AutoMapper/AutoMapper )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM