This walkthrough covers the migration of tables and primary/foreign keys that is a reasonable assumption when accessing data using ORM.
- Visual Studio 2010 (should also work with Visual Studio 2008 with .NET 3.5 SP1 applied).
- Devart dotConnect for Oracle (formely known as OraDirect.NET) that supports Entity Framework capabilities.
Steps to migrate data schema
1. Create a C# class library project using Visual Studio 2010.
2. Delete a class created in a projects (“Class1”) and add a new item using “ADO.NET Entity Data Model” template.
3. Select “Generate from database” and choose SQL Server database that contains the schema to be migrated.
4. Select “Tables” in the next screen (“Choose Your Database Objects”), and Visual Studio will generate a model based on the selected database schema.
Now if you right-click on a model diagram, Visual Studio will display a menu with an option “Generate Database from Model…”
If you choose database generation, Entity Designer will generate a script for Microsoft SQL Server.
4. Assuming Devart dotConnect is installed, it should be possible to change a template that is used to generate database script. Open “DDL Generation Template” combo box in Entity Designer Properties window and select “Devart SSDLToOracle.tt (VS)”.
5. After the change of DDL generation template execute “Generate Database from Model” and you should get a script for Oracle data schema:
This post has been written using Windows Live Writer 2011 with FiftyEightBits PreCode Snippet. This is C# code sample:
public void Test()
And this is F# code:
let rec search m x y f accu = match x, y with
| x, y when x = size2 -> search m 0 (y + 1) f accu
| 0, y when y = size2 -> f accu
| x, y when m.(y).(x) <> 0 -> search m (x + 1) y f accu
| x, y ->
let aux accu n =
if invalid m 0 x y n then accu else begin
m.(y).(x) <- n;
let accu = search m (x + 1) y f accu in
m.(y).(x) <- 0;
fold aux accu 1 10
Well, actually I used C# brush for F# code. Hope that the server will be update with F# brush soon.
UPDATE. Dennis van der Stelt who is in charge for BloggingAbout.Net updated the server with new brushes, so I can now write as much F# code as I want. Thank you very much, Dennis!