I'm interested to find out which ORM has best support for Postgres SQL database? Does any mapper have, both, LINQ support and ability to generate model from database?
I haven't compared it against DbLinq but LlbgenPro supports Postgres and is very strong. It supports both Linq and generating the model from the database. In it's just released v3.0 it can generate projects not just for the LlblGen runtime but also for NHibernate, Entity Framework and LinqToSql.
It should be in your list to evaluate.
I would say NHibernate is your friend here.
Quite an old question, but for anyone happening upon this now (like me), please do check out the Marten document & event store for PostgreSQL/.net
DbLinq
You can use NEntityDb. With NEntityDb for PostgreSQL you can query and save data to the database with .NET LINQ Expressions and Fluent API.
Related
Does anyone know if you can use LINQ techniques for querying a Microsoft Access database? In my online searches for this question, I have gotten mixed reviews. Some have said it's 'sort of possible' while others say LINQ can only be used with an SQL server database.
Does anyone know the definitive answer on this?
LINQtoSQL can only be used with a SQL Database.
Entity Framework can work with SQL or Access.
LINQtoEntities can work with the Entity Framework.
General LINQ methods can work with IEnumerables regardless of how they were populated.
I'm opening a discussion here on a subject I couldn't find any answer good enough to be called a final answer: MySQL and .NET.
While I know there is a lot of ways to make this connection, I'm trying to find a list of pros and cons of each approach.
I've been using ADO.NET with the MySQL NETconnector since the beggining of my project, and everything was ok when the database was new and didn't have many records. But now I'm facing a situation where the number of records grows exponentially, and I found other way of querying against the database, which is the ODBC connector. Using the ADO.NET + NETConnector solution I had my O/RM and didn't have to write my queries, while ODBC makes my code look awful now (since I didn't switch completely to ODBC, I have Linq queries and plain SQL queries inside my code).
Is there any solution (free or not) where I can have both an O/RM without the need of writing SQL queries myself and the speed of ODBC?
What you should be doing is using the MySQL ADO.NET Connector and storing your queries in the database in the form of stored procedures. Version 6.0 of the MySQL connector also supports The Entity Framework. If you are interested in using the Entity Framework, check out this link which describes how to set that up.
NHibernate
Update to Comments
NHibernate Proxy Generators
It is a byte code generator for your object model that allows NHibernate to perform lazy loading and other operations. The link provided explains the benefits.
Castle and LinFu are two different implementations of those Proxy Generators.
While NHibernate does not have coincide documentation all the information on how to use it, is on the internet. This could be a barrier to usability for some people though. I understand more about NHibernate because of my past experience with Hibernate.
Is there a way my DAL classes can be re used across different databases ?
I know some technologies (Linq and EF) support rapid development, I appreciate this feature but I also want to keep my DAL Code reuse able in different database.
A Simple thing that come to mind is use of Oledb with inline SQL queries, Is there a more elegant way ? please guide me. I am just considering 2 things.
support to 4 most commonly used databases (SQL Server, My SQL, Access, Oracle).
Rapid development support.
Thanks
You may consider using an ORM framework such as Entity Framework or NHibernate. This way your data access layer will be database agnostic.
If you stick to the interfaces (IDbConnection, IDbCommand, ...) and their factory methods (IDbConnection.CreateCommand) then the only code that needs to know what database you are using is the initial connection creation (which can be encapsulated).
Entity Framework does the work you want. The most commonly used databases support it, with the exception of Oracle. For Oracle, you have to use third-party components as the official Oracle support for Entity Framework is still in beta.
Im developing a windows forms application using C# 4.0 and that application is going to target different database engines like SQL, MySQL and Oracle i was wondering if there is a library that can talk to all the three engines instead of implementing my own layers for every one.
thanks in advance.
You could use an ORM tool; I like NHibernate But there are many more: see a list at wikipedia.
The problem is if you want to do anything remotely advanced (date arithmatic, generate primary keys, get the id of the last inserted record, pivot a table , use RANGE construct etc.) then both databases use completely different syntax.
The best solution (in the java world at least is either Ibatis or Hibernate) I know there is a .NET version of Hibernate I am not sure about Ibatis.
These libraries insulate your program from the various SQL dialects and provide a common API independent of the underlying database.
If you use the classes in System.Data.Common you can make your code database independent:
Writing Provider Independent Code in ADO.NET
I don't know C#, but I know it will have a library for ODBC.
It looks like MS has one here.
It's old, but actually it does the job just fine. Virtually every DB in existence provides an ODBC driver.
Checkout DbLinq.
DbLinq is THE LINQ provider that allows to use common databases with
an API close to Linq to SQL. It currently supports (by order of
appearance): MySQL, Oracle, PostgreSQL, SQLite, Ingres, Firebird...
And still SQL Server.
Just wanted to know if Linq to entities 4.0 have fulltext search capabilities? Thanks
There are no specific operators or support for full text directly in EF v4.0.
I think that is a server option.
Anyways, if it does not (in EF), nothing stops you from calling the required SQL directly. :)
I've been using custom stored procedures for my Sql Server 2008 FullText capabilities (eg. CONTAINS(.. .. ). Of course, EF can call stored procedures.
This is an option you can leverage off. Works great for L2S and/or EF.
HTH.