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
|
Hi Guys, provider - MySQL code:
namespace Sandbox { class Program { private static LightSpeedContext<DALUnitOfWork> _context;
static void Main(string[] args) { _context = new LightSpeedContext<DALUnitOfWork>("default"); _context.IdentityMethod = IdentityMethod.IdentityColumn;
using (var uow = _context.CreateUnitOfWork()) { Registry r = new Registry(); r.Created = DateTime.Now; uow.Add(r); uow.SaveChanges(); Console.WriteLine("Total Registries: "+ uow.Registries.Count()); } } } } If I remove this line:
_context.IdentityMethod = IdentityMethod.IdentityColumn;
then I get the error, that KeyTable doesn't present in DB. I don't want on the code level write this line above, how can I persist it in app.config?
I tried to do
<lightSpeedContexts>
<add name="default"
connectionStringName="Dev"
dataProvider="MySQL5"
IdentityMethod = "IdentityColumn"
/>
</lightSpeedContexts>
and got this exception:
Unhandled Exception: System.Configuration.ConfigurationErrorsException: Unrecogn
ized attribute 'IdentityMethod'. Note that attribute names are case-sensitive. (
D:\Development\net\experiments\DAL_MVC_EXTJS\Sandbox\bin\Debug\Sandbox.exe.Confi
g line 18)
what should I do?
|
|
|
ok solved should be this
<lightSpeedContexts> <add name="default" connectionStringName="Dev" dataProvider="MySQL5" identityMethod="IdentityColumn" /> </lightSpeedContexts> I had IdentityColumn (camelcase) and it should be from lowercase. |
|