This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hiya
I'm using a MySQL5 database, which contains a table "Users" The table is pretty simple - as this is mostly just to see how things are done in LS :
LightSpeedContext<DBUnitOfWork> ctx = new LightSpeedContext<DBUnitOfWork>();
I've had some experience with LINQ to SQL, so I was expecting something in the lines of InsertOnSubmit/SubmitChanges but it turned out that it's done using the uow.Add()
|
|
|
Add is the equivalent of InsertOnSubmit. You need to call IUnitOfWork.SaveChanges (our equivalent to SubmitChanges) to commit the pending changes to the database. Password obfuscation is outside the scope of LightSpeed, but I believe you can do this using encrypted connection strings. Here's an article about this. To perform update operations, load the entity, make your changes, and call SaveChanges: var user = uow.FindById<User>(1); To perform remove operations, load the entity, call IUnitOfWork.Remove, and call SaveChanges: var user = uow.FindById<User>(1); Adds, updates and Removes can of course all be queued up and will be performed in a batch when you call SaveChanges. |
|
|
Awesome, cheers Ivan. |
|