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

Is help manual actual? Getting lost with DB connection

2 Answers 47 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wolfgang
Top achievements
Rank 1
Wolfgang asked on 22 Oct 2012, 01:15 PM
Hi,

it tried the following:

Use the Database first scenario - hm.. first errors, Sybase connection needed to be configured manually, new did not work.

Okay, with a little bit of guessing (would be easier if the format would be given) i had a connection to db.

Second, try to create a consuming model.

And now i'm completly stuck.

My model name is as in example "EntitiesModel". If I look in definition  it is derived from OpenAccessContext:

EntitiesModel:

 

 

OpenAccessContext, IEntitiesModelUnitOfWork



The Namespace is "TestConnection".

If I try something like
using (EntitiesModel dbContext = new EntitiesModel())
{ ...dbContext.SaveChanges();}

there are no members to access the opencontext, only to the distinct persistent classes.

How do i find the context?


2 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 24 Oct 2012, 03:14 PM
Hi Wolfgang,

 Have you selected any entities to be generated in the step after you have specified the connection string? Basically if you have you should have some persistent classes generated together with the context and inside the context you should find some end points defined like that:

public IQueryable<Product> Products
   {
       get
       {
           return this.GetAll<Product>();
       }
   }
Later on you can use those end points to access the data in the tables that correspond to them. If you are a newcomer in the OpenAccess world then I suggest you to have a look in our getting started section in the online documentation as it provides some easy to follow step by step guides on how to quickly get started with OpenAccess.

All the best,
Petar
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Wolfgang
Top achievements
Rank 1
answered on 25 Oct 2012, 08:22 AM
Hi,

i used the quickstart to run into this error.

The funny thing was, that new creation with same steps worked.
I had a lot of persistent classes, so they weren't the missing thing.

Only things like ".SaveChanges" method was not visible.
Tags
Getting Started
Asked by
Wolfgang
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Wolfgang
Top achievements
Rank 1
Share this question
or