Is there a tool that will create Java or .NET classes from a db4o database file? - db4o

I have a db4o database file. Is there a tool that will generate Java or .NET classes (source) from this database?

None that I'am aware of.
But it should not be to hard to write one. You can use ObjectContainer.Ext().KnownClasses() method.

Related

No option to add EDMX file to project in MVC solution

I've created an MVC application. I would like to now add a new class-library project to the solution, and then add an EDMX file to that project.
This used to be easy. But now I have to choose between .NET Core and .NET Standard. But it appears it doesn't matter which I choose because if I create a class library with either of these frameworks, Visual Studio provides no option for adding an EDMX file to them! And I don't see an option to add a standard .NET Frameworks class library.
So what is the secret incantation to add a new project to my MVC solution, and then add an EDMX file to that project?
Note: I do have the option of adding an EDMX file directly to the MVC project. But I would prefer to place it in a separate project, which I've done before.
EDMX file is deprecated with EF Core and I believe it has been removed from .net core projects as well.
If you need to do that, you may need to add it to a normal .net 4.5 project and copy the files but this will make no sense using it with .net core or .net standard.
You should be using Code First anyway as it is cleaner and easier to use.
If you already have the database, you can refer to this link, it can help you to scaffold the classes from the database
https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db
#Jonathan: The EDMX file is old way of doing things. EDMX is nothing but a T4 template which facilitates in creation of edmx.
With .Net Core the best way is to:
1. Create a .net core library project. Add entityframeworkcore nuget package from here
2. The use this link, to generate your model's from DB
The concept of EDMX is not supported anymore.
Hope this helps.
Based on your description you're using the old ASP.NET MVC framework, and not the new Core one, and in this case you're using the Full .NET framework. So, when you create the new Class Library project, you should do it with the Full .NET Framework, because .NET Core and .NET Standard does not support, EDMX. If you chose this one, you can add your ADO.NET Entity Data model to it:
At least for EF v6, if your using EF Migrations, each ('state'/'target') snapshot of the database (stored within the migrations-history db table & migration file) is an EDMX file just waiting to be decoded, saved to a file, and then loaded in VS (Visual Studio). ;)
It's a little in-depth (or at least challenging), but 'System.Data.Entity.Migrations.Edm.ModelCompressor' may present the clue.
Basically, you can extract the EDMX from one/the relevant migration. But I do agree that the Code-First approach should be used for the implementation, the EDMX is only a development-aid these days.

F# type providers with EF Code First / Continuous Integration Issues

We have a large C# EF Code First based code base. Recently one F# project was added. The project uses FSharp.Data.SqlClient (http://fsprojects.github.io/FSharp.Data.SqlClient/) type provider to connect to DB.
That created a huge problem: F# type provider needs DB (and all referenced structures) to exist before the whole project can be complied from scratch, but EF needs to compile the whole project before it can create / update the DB. Subsequently, the DB can no longer be created from scratch or even modified.
While not using type providers is, obviously, possible, it is not an appealing solution because it nullifies the whole purpose of type providers and requires writing code that's already done by them.
Does anyone has any ideas how to deal with that? Thanks a lot!
Expanding on my comment, assuming you have currently only 2 VS projects:
Your C# project that contains everything including the EF code
Your F# project that contains the code that uses the type provider
What you could do is turn in into a 3 project solution:
A new and small C# project that only does EF stuff (migrations, schema definition, classes declaration)
Your F# project that contains the code that uses the type provider
Your existing C# project that would not contain the ef classes and ef related things but that references both #1 and #2.
That way, you EF C# project can compile first then run the migrations. Then your F# project would compile fine. Finally your 3rd project (that contains the rest of the logic that depends on both the EF and F# projects) can compile successfully.

What is a good lightweight database that can be used for an ASP.NET MVC application?

I need lightweight database for an ASP.NET MVC application.
would prefer not to install anything additional on the host box
would also prefer being a little more robust than XML
would like to use activerecord or entity frameworks
SQL Server Compact Edition claims to have an "XCopy" installation (copy and run), and it would have the fewest integration headaches.
You can check sqlite
Sqlite http://www.sqlite.org/
visadb http://www.vistadb.net/
Firebird can do the job well
The embedded version is an amazing
variation of the server. It is a fully
featured Firebird server packed in
just a few files. It is very easy to
deploy, since there is no need to
install the server.

db4o viewer - Java / Linux

I need a db4o viewer for a Linux box running Java. I noticed this post was for a .net client, but I don't have Windows and don't intend to.
Is there something I can use? I checked out some projects, but they look like they haven't released any files yet so I haven't found anything that will work yet.
Walter
You can use Object Manager Enterprise (or OME for short). AFAIK it is bundled with db4o java packages.
Maybe you can use object manager that bundled with db4o distribution. Or, you can use eclipse ide plugin search Object manager. Its also called OME.
I usually use eclipse ide to see the data, and there are query tool too.
HTH

Modular Architecture - ASP.NET MVC

I've searched (google and SO) about this topic and couldn't find a thorough answer to my question(s).
I'm building an ASP.NET MVC 2 application that will be distributed to other people (with source code). These people will need to create modules/plugins that use the application's base.
The base is a simple ASP.NET MVC Application with Linq-To-Sql file, repositories, authorization/membership.
Is it possible to create a plugin that would work by simply adding a .DLL file in a folder?
Right now, you can create a "plugin" by opening the source project of the base application, creating a few controllers/views that do somethings, using the base application's authorization/membership and repositories. You would also be required to edit the Linq-to-Sql file and add in any tables that you need.
However, to "install" this plugin, I would need to copy the controllers/views for this plugin into my base application and edit the Linq-to-Sql class to include the tables necessary for this plugin, then build the solution. Is there a simpler method?
I read of .DLL plugins, but how would someone build a plugin like this starting from the base application.
If the 'plugin' creates tables with foreign keys of the "User" table in the main application, how does one separate those tables/relationships in a separate file and have the base application recognize those relationships?
As you can tell, I'm asking multiple questions that are kind of all over the place. This is a new topic/issue for me and I have no idea where to start. Theme mere concept of having my application interact with a separate .DLL file is foreign to me.
Any help/links would be greatly apprecaited.
Does this answer the same question: Plug-in architecture for ASP.NET MVC?
I think this could be applied to mvc too: http://msdn.microsoft.com/en-us/library/ms972962.aspx

Resources