lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I do provide a simple code structure to my teammates so they can focus on the db logic:



local ctx = MyDatabase()



local entity = ctx.Users:Add{ name = }

entity.create = Date.Now



self:Redirect(“/user/profile/” ..

end, function(err)





The “with” can have several objects with Open/Close method, so they can be called at the start and the end point. The second function is the error handler, if it’s omit, the “error” will be used so it can be handled by the global error handler.