LINQ and Lightspeed, some oddities...(hockblogs.net)
submitted by
hockman(505) 3 years ago
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);
|category: Linq
|Views: 24
tags:
LINQ another
Everyones tags:
Your Tags: