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
|
Again me that late... maybe too late so I can`t find my own bugs :P
I do exactly what you do in your samples: public class DataAccess { public static LightSpeedContext _context; public static LightSpeedContext Context { get { if (_context == null) _context = new LightSpeedContext("Development"); return _context; } } } static void Main() { using (IUnitOfWork uow = DataAccess.Context.CreateUnitOfWork()) { // uow.NoEntitiesHere... } }
Why are there no entities when I type uow.SchoolclassCode ?
Do you have a secret code tag for the code pastings?
|
|
|
Because you wrote: using (IUnitOfWork uow = DataAccess.Context.CreateUnitOfWork()) The compiler knows only that uow is an IUnitOfWork -- *you* know that it will actually be a SchoolModelUnitOfWork, but you have told the compiler that the uow variable could be *any* IUnitOfWork. Change IUnitOfWork to SchoolModelUnitOfWork (or, more easily, var) and you will be good to go. I don't think we have a code tag but you can use the "HTML" button to tweak the formatting at the HTML level. |
|
|
>> Do you have a secret code tag for the code pastings? I'd been meaning to add this for a while and have just done so. I edited your original post so that it is now pretty printed. To achieve this, view the HTML view of your post and do the following: <pre class="prettyprint> Paste your raw source code here </pre> Note: You will have to do this while in the HTML view. These fancy editors are just a bit too fancy and will try and format your code for you when you paste it directly into the box. I hope that helps, John-Daniel |
|
|
yes I thought too that SchoolModelUnitOfWork must work anyway because it implements IUnitOfWork and I used var before... but still It did not show my entities ?? |
|
|
When I am at home I will deinstall the free version again because of 2 reasons to maybe make the UOW working with my entities: I had before an older version installed and while installing a new version I thought/had the feeling it was not cleanly removed. 2nd is I tried more than 8 models and got an error message , then I did something and my VS hang up... So I try to install it cleanly again and let you guys know! |
|
|
funny I got no error.
I did this public static LightSpeedContext Context
instead of
public static LightSpeedContext<SchoolModelUnitOfWork> Context
;-)
|
|