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

Code-Only Mapping (How to add an entity)

2 Answers 45 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.
Ron
Top achievements
Rank 1
Ron asked on 02 Nov 2015, 04:42 PM

So I have followed all the instructions from the article at http://www.telerik.com/blogs/benefits-of-code-only-mapping-and-how-to-get-them and was able to get my data layer back to compile using the NuGet packages. My solution now is useable in Visual Studio 2015. However, now I need to add a few tables(entities) to my context. Is there an article explaining how to do this? 

I can stub out my POCO classes (although this stinks to have to do this by hand) and hack my way through adding the entities the OpenAccessContext and IUnitOfWork but my main concern is the FluentMetadataSource.cs file. This file has a lot of configuration in it. If you could point me to an article explaining how to add entities to a fluent model I would much appreciate it.

2 Answers, 1 is accepted

Sort by
0
Marko Gluhak
Top achievements
Rank 1
answered on 04 Nov 2015, 10:04 AM

Hi,

I have those "problems" and for now I manage to understand it. Its really not so hard. MWorst problem is having mindset change not to use visual designer.

I have started with this overview on document pages.

This gives you basics. After that I use several of my OLD project with this article and then learn from conversion code. For that you will need VS2013 and still installed DataAccess Q1 2015. I use virtual machine for that. I also use that approach when I try to see how is somehthing done that I did not have in old project. I simply create tables in new database, create new database first project and convert it to fluent model. Its long process but it give me insight of how dataaccess would make my fluent model which cannot be bad :).

With regards,
Marko

0
Accepted
Kristian Nikolov
Telerik team
answered on 05 Nov 2015, 03:49 PM
Hi Ron,

Thank you for contacting us.

We would recommend you checking the Code Only Mapping section of our documentation. As Marko Gluhak has suggested, Getting Started is a good introduction. The How To: Map Your Model Using Explicit Map article in particular will show you how to map classes to tables.

I hope this helps. If you have additional questions do not hesitate to get back to us.

Regards,
Kristian Nikolov
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
General Discussions
Asked by
Ron
Top achievements
Rank 1
Answers by
Marko Gluhak
Top achievements
Rank 1
Kristian Nikolov
Telerik team
Share this question
or