Code-Only Mapping (How to add an entity)

3 posts, 1 answers
  1. Ron
    Ron avatar
    4 posts
    Member since:
    Jun 2011

    Posted 02 Nov 2015 Link to this post

    So I have followed all the instructions from the article at 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. Marko Gluhak
    Marko Gluhak avatar
    68 posts
    Member since:
    Apr 2006

    Posted 04 Nov 2015 in reply to Ron Link to this post


    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,

  3. DevCraft banner
  4. Answer
    Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 05 Nov 2015 Link to this post

    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.

    Kristian Nikolov
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top