Is Linq to NHibernate in the 2.1 Alpha release? - linq

So the nHibernate 2.1 Alpha came out a few days ago, but the announcement on sourceforge doesn't mention the additional features. In particular, it doesn't mention whether LINQ is included. I know that I've read that LINQ would be part of 2.1, but that was 6 months ago. Anybody know if LINQ is in 2.1 or what new features are? There's no documenation about 2.1 alpha features on the official site.

LinqToNHibernate is being written by Steve Strong at IMeta. Steve is attempting an amazing task by changing the way NHibernate parses HQL from the string based system to an abstract syntax tree. To be fair he does have a head start as this is being done in Hibernate using ANTLR which he is porting to .Net. It still baffles my mind what he is undertaking. I must say well done to IMeta for giving Steve the time to work on this.
If you want to see how far he is going you can check the uNhAddIns repository.
There is also a workable LinqToNHibernate provider which you'll find in NHContrib I am using this on a few projects and it works well but isn't in active development now and does break down if you attempt complex Linq queries

Related

How to use a different data model with EF

I am not even sure how to ask this question. I am absolutely willing to research this myself, but I don't even know what exactly my options are.
I'm fairly new to programming in general, and I'm the sole developer on an ASP.NET MVC3 web application. We're about to upgrade to a new version which has a lot of addition to the data model. There are a couple new entities and some of the old entities have new properties/columns.
We've finished beta testing and now we're going to try to get everyone moved over to the new version running parallel to the current version, that way if there are show-stopping problems, users can easily switch back to the old version. The problem is that we can't hook both up to the same db because of the data model differences.
Can I make the old version use the new version's schema or something? I'm not really sure what my options are. I'm not asking you to write this for me; I'm just looking for some direction. Thanks!
You should be able to disable the metadata checks and then use two versions against the DB assuming the models use a schema that is compatible between both.
http://revweblog.wordpress.com/2011/05/16/ef-4-1-code-first-disable-checking-for-edmmetadata-table/
Another option is to use entity framework 4.3 code first migrations and actually use an upgrade script that it will generate for you. If it fails you can roll back the script to a prior version and use your prior code base. This would imply you upgrade to 4.3 first before doing anything else though although you could still disable metadata checks.

Using LINQ to SQL in ASP.NET MVC2 project

Well I am new to this ORM stuff. We have to create a large project. I read about LINQ to SQL. will it be appropriate to use it in the project of high risk. i found no problem with it personally but the thing is that there will be no going back once started.So i need some feedback from the ORM gurus here at the MSDN. Will entity framework will be better? (I am in doubt about LINK to SQL because I have read and heard negative feedback here and there)
I will be using MVC2 as the framework. So please give the feedback about LINQ to SQL in this regard.
Q2) Also I am a fan of stored procedure as they are precomputed and fasten up the thing and I have never worked without them.I know that LINQ to SQL support stored procedures but will it be feasible to give up stored procedure seeing the beautiful data access layer generated with little effort as we are also in a need of rapid development.
Q3) If some changes to some fields required in the database in LINK to SQL how will the changes be accommodated in the data access layer.
When it comes to Linq-to-Sql vs Entity Framework, I strongly suggest to use Entity Framework. With the release of .NET 4.0 and VS2010, Microsoft added soooo much goodness in Entity Framework(EF) 4.0. Let me just mention a few points: POCO and NTier support (this means that you can have a separate library with your simple entity classes and of course EF will still be aware of them), Lazy Loading, Sql query optimizations...Also you can let EF to generate your entities (and you have the option modify the T4 generation template) or you can create them by hand if you need more control. Also, if you app will indeed be large, with EF 4, now you can separate your layers quite nicely(you can create your Mocks fo testing etc...). I'm not a web developer, so I cannot give you any hints on mvc2 on this matter.
q2-q3) - in EF you can have precompiled queries - IF you observer later on that query performance is not quite what you need. This will speed-up things quite a bit. If you plan to use EF and if you add a few changed to you database, you can easily update your model with a click.
I know I babbled too much on EF and not Linq to sql :), but hey...I believe this suits way better on your needs and you should definitely check it out for this project. Also, I don't know how much Microsoft will add features / invest in LinqToSql in the future.
Cheers,
ok precompiled queries that certainly is catching my attention.

Linq to NHibernate : is it mature?

I'm thinking about using Linq to NHibernate in an upcoming project, so I'd like some feedback about it. I found this identical question asked in February, and it seemed that Linq to NHibernate was not very mature at this time... Has it improved since then ? Has anyone used it in real life applications ?
Thanks for your feedback
PS: please do not close as duplicate : the existing question is almost 1 year old and I'm asking about the current status of the product...
Ayende (one of the more vocal contributors to NHibernate) noted in a blog post this week that NHibernate's LINQ support is somewhat lacking (as compared to Microsoft's Entity Framework). I don't believe much has changed in the last year in the production code base. He does note that the next version of NHibernate will improve on this support.
Linq to NHibernate is OK most of the time, but you need a fallback option.
I use it in a large project as the default query language as I expect it to become more mature soon, and I especially like its agnosicism towards the underlying framework - you can use it if you know the basics about O/R mappers and Linq; you don't need to be super-familiar with NHibernate in special. The other options for writing queries, especially the criteria query API, pose some extra learning effort. For most of the features, complex queries are not required, and Linq to NHibernate is good for some Wheres and OrderBys.
However, there are still odd cases of failure where the query itself is OK, but the generated SQL just is not. In these cases I don't spend time examining what's up, but fall back to the criteria query API.
Please refer to http://nhibernate.info/blog/2009/12/16/linq-to-nhibernate-progress-report-a-christmas-gift.html for the latest info
Hey I follow Steve Strong, as from what I understand, he is the main developer of this project.
here is his latest post "Using the new Linq to NH Provider and migrating from the old one " http://blogs.imeta.co.uk/sstrong/archive/2009/12/16/824.aspx note it was just after the NHForge latest post on this topic.
To get this version look at the HornGet link provied in the post
I looks really promising
bones

How to generate database class files with SubSonic 3?

I've been using SubSonic (ActiveRecord) for a couple of years. I've been waiting until a few of the bugs in 3.0 were fixed before downloading the newest release and upgrading my few sites that use SubSonic to 3.0. I'm currently using 2.2 on these sites. I'm working on a new site and wanted to use 3.0 to get a grip on the new updates before going back and updating my existing sites to 3.0.
However, I'm stuck and the old SubSonic site with forums and useful help documents seemed to have all changed and there's nothing there that I can find to answer my basic questions.
How can I generate database class files with SubSonic 3?
In version 2.x, I used the SubCommander tool integrated with Visual Studio and it just took a click of a menu choice to regenerate all of the class files. Now, there's just a single binary .dll file and no information on how to actually generate my class files.
This question is posed for a new database and new web site, but I have several other existing web sites/databases that I'd like to upgrade. Is there a document on how to transition from SubSonic 2 to SubSonic 3? Preferably, a document that takes into consideration existing implementations.
There isn't a document on transitioning from 2 to 3 although I think it'd be a great thing for someone to write. However you should find answers on how to get started from the docs site.
In particular it sounds like you should have a look at:
The 5 minute ActiveRecord demo
Using SubSonic 3 ActiveRecord
ActiveRecord overview
This question should also have answers to some of the pitfalls when get started with SubSonic 3 and t4.

Sample Project for NHibernate Search using Lucene.Net

Is there any Asp Dotnet projects samples available using Lucene Dotnet
I am personally a huge fan of the LINQ to Lucene project.
It did not meet all of our requirements, but with the source code available it was a snap to make adjustments.
An easy to follow simple example of use can be found at Hacky Hacky
Also, a quick search at Code Project will quickly show you numerous uses of Lucene.net. While they are frequently not ASP.NET projects out of the box; with a little adaptation you should be able to employ many of the libraries there in a webform project.
A great starter article there can be found at Introducing Lucene.Net.

Resources