locked
Help Oracle + EF Code First Tables With Database First Table RRS feed

  • Question

  • User280208792 posted

    Hi,

    I am very new to asp.net and EF and am currently in the the process of building my first major MVC application. I have been working so far with a code first approach for the tables that the application will use to store data, however now I have come to the part where I need to pull data in (on read only basis) from an Oracle database.

    Is it possible and how can I go about interfacing with the Oracle tables, in the same way I would with the SQL tables that I have generated from a code first approach?

    Also is it possible and can you give me an example how I can use linq and repository pattern that I use with my code first tables to interface with Oracle tables?

    In the repository pattern I have create a generic class that you pass in an entity and it will give Get() GetByID() Delete() Update().

    With the Oracle db I also need a way to make sure it is only used in a read only manner, ther Oracle database is governed by the HR systems Business rules engine and so to write back to it there is another method and the system I am building is going to do this action in monthly imports.

    Finally is it possible to create a sql table that is almost a combination of an Oracle table or part of an Oracle table and then some additional data. I will try to explain, if we have in the Oracle database a table called contracts, on this table there is a unique AlphaNumeric Code field and a Description field. What I want to do is use these 2 fields to populate a sql table (and if changes are made to the Oracle table these be reflected in the SQL table) then add additional fields in the sql table like Hours/Week, Weeks/Year etc.

    I know there are a fair few questions here so any help addressing them would be much appreciated, also is there anything I need to install to get this functionality?

    Many thanks,

    Andy

    Sunday, June 24, 2012 5:40 AM

Answers

  • User280208792 posted

    Hi,

    I have purchased devart DotConnect for Oracle developer edition, I planned a week to work out how to get this all working, and with a bit of fumbling around I managed to replicate all my patterns and connect the 2 data sources together in less than an hour!

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 18, 2012 8:19 AM

All replies

  • User280208792 posted

    Has anyone used any of the Devart products such as Entity Developer or DotConnect to achieve anything like this?

    And do you have any opinions on how they work or how they would fit in with my application as described above?

    Many thanks,

    Andy

    PS I user Repository Pattern, UnitOfWork and am also trying to implement IAuditable and IAuthorisable Repository as well as a business logic layer.

    Friday, June 29, 2012 8:48 AM
  • User-1984973868 posted

    If you are using EF Code first approach with database then you specify your connection in web.config file. It may solve your problem.

    Thank you.

    Tuesday, July 17, 2012 1:02 PM
  • User280208792 posted

    Hi,

    I have purchased devart DotConnect for Oracle developer edition, I planned a week to work out how to get this all working, and with a bit of fumbling around I managed to replicate all my patterns and connect the 2 data sources together in less than an hour!

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 18, 2012 8:19 AM