I have the following code: This creates a line in my 'Persons' table where Name is NULL but id has a value. Any idea's? |
You must use
Otherwise DataObjects.Net won't have a chance to intercept property access operation. An example of manually defined persistent property in C#:
So you shouldn't declare backing fields as well. P.S. When auto-property is used, its getter and setter are overwritten by PostSharp by absolutely the same way - this is easy to check using e.g. RedGate .NET Reflector. Auto-properties aren't an option. I'm using .NET Framework 3.5. I'll implement the GetFieldValue and SetFieldValue functionalities. Working like a charm. Oh, quite quick response ;) Btw, VB10 \ VS2010 can target .NET 3.5 (may be this will be helpful). I'll keep that in mind, got it installed anyway. Thanks |
I tried the same thing in VB10/VS2010 but the same problem occured. My Class:
Field is entered correctly, also on Query.All(Of Project), but Name and Description remain 'Nothing'. Likely, there is a bug related to VB.NET auto property recognition by our aspects - there are no automatic tests for DO4 on VB.NET, so it isn't a VB.NET-friendly, and that's mentioned in manual; but we're ready to fix all the issues related to VB.NET support ASAP. We don't expect any really blocking ones - we were supporting VB.NET in previous version of DO (v3.X), so we're aware about differences. Issue 829 is created. We'll try to fix it in several days. |
When i add the DefaultValueAttribute the DefaultValue is saved to the database. Still not the .Name = "John" value.