Hi there,
I'm currently developing an ASP.NET (actually rewriting a PHP website) website, and since my provider doensn't support SQL Express, I had to use MySQL (could have used SQLLite ofcourse, but I went with MySQL).
I found this really cool ORM tool, called Lightspeed. Since I don't have have that many tables in my simple website, I can use the free edition.
So following the tutorial, I create a new LightspeedContext.
LightSpeedContext<ModelUnitOfWork> db = new LightSpeedContext<ModelUnitOfWork>();
List<Picture> pictures = new List<Picture>();
using (var unitOfWork = db.CreateUnitOfWork())
{
var pics= unitOfWork.Pictures.Select(p => new Picture() {Name = string.Format("/book/photo/{0}.jpg", p.Name), Description= p.Description ?? string.Empty});
}
pictures.AddRange(pics);
This results in the following exception
:
bij Mindscape.LightSpeed.Linq.TranslatableExpressions.TranslateMethod(MethodInfo method)
bij Mindscape.LightSpeed.Linq.LinqQueryTranslator.VisitMethodCall(MethodCallExpression m)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.Visit(Expression exp)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.VisitMemberAssignment(MemberAssignment assignment)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.VisitBinding(MemberBinding binding)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.VisitBindingList(ReadOnlyCollection`1 original)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.VisitMemberInit(MemberInitExpression init)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.Visit(Expression exp)
bij Mindscape.LightSpeed.Linq.Sqo.Select.OnVisit(LinqQueryTranslator visitor, MethodCallExpression expression)
bij Mindscape.LightSpeed.Linq.Sqo.SqoBase.PerformVisit(LinqQueryTranslator visitor, MethodCallExpression expression)
bij Mindscape.LightSpeed.Linq.LinqQueryTranslator.VisitMethodCall(MethodCallExpression m)
bij Mindscape.LightSpeed.Linq.ExpressionVisitor.Visit(Expression exp)
bij Mindscape.LightSpeed.Linq.LinqQueryTranslator.Translate(Expression expression, IUnitOfWork unitOfWork, String viewName)
bij Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression)
bij Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression)
bij Mindscape.LightSpeed.Linq.LinqQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
bij System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
bij System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
bij Foto.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\Rhock\picture.aspx.cs:regel 62
bij System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
bij System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
bij System.Web.UI.Control.OnLoad(EventArgs e)
bij System.Web.UI.Control.LoadRecursive()
bij System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
But when you write:
var pics = Enumerable.Select(unitOfWork.Pictures, p => new Picture() {Name = string.Format("/book/photo/{0}.jpg", p.Name), Description= p.Description ?? string.Empty});
pictures.AddRange(pics);
all goes well... I guess Mindscape just didn't implement their LINQ stuff right! You have to use Enumerable.Select (from the .NET Framework 3.5 LINQ class) instead of the LINQ select from the Lightspeed UnitOfWork class. This is a workable workaround for me! 
I think that Lightspeed is a really great ORM tool, that works wonderfully with a MySQL database.
I used the following tools for this project:
Visual Studio 2008 Professional Edition
C#, ASP.NET 3.5
MySQL
MySQL connector/.NET 6.0 (used by Lightspeed)
Mindscape Lightspeed ORM tool, version 2.2
HeidiSQL 4.0
And oh man....I do love Lambda Expressions!
Hope this is usefull!
gr,
Robbert