This question is locked. New answers and comments are not allowed.
Hi,
I defined a struct inside a class. I wish to use that nested struct as a column type.
However, the Forward Mapping window tells me that I should mark the property as Transient, because the used datatype is either not marked as Persistent or is of a non-supported type.
I marked the struct as Persistent, so that should not be the problem.
When I move the struct out of my class, then Open Access gives no problems: it recognizes that I;m using a struct as a column type.
My question is, is it somehow possible to use a nested struct?
Below is a simple code snippet of what I mean by nested struct:
That structure does not seem to be supported, or is there a trick that I can use?
It would be nice if it worked. In my project I have several structs that are hlpers of a certain class, so it would be nice if I wouldn't have to put them in the same namespace as the rest of the entities, but instead isolate them a bit.
Thanks,
Sipke
I defined a struct inside a class. I wish to use that nested struct as a column type.
However, the Forward Mapping window tells me that I should mark the property as Transient, because the used datatype is either not marked as Persistent or is of a non-supported type.
I marked the struct as Persistent, so that should not be the problem.
When I move the struct out of my class, then Open Access gives no problems: it recognizes that I;m using a struct as a column type.
My question is, is it somehow possible to use a nested struct?
Below is a simple code snippet of what I mean by nested struct:
[Persistent] |
public class User |
{ |
// Private fields |
private Address homeAddress; |
private Address workAddress; |
// Properties |
[FieldAlias("homeAddress")] |
public Address HomeAddress |
{ |
get { return homeAddress; } |
set { homeAddress = value; } |
} |
[FieldAlias("workAddress")] |
public Address WorkAddress |
{ |
get { return workAddress; } |
set { workAddress= value; } |
} |
/// Nested struct |
[Persistent] |
public struct Address |
{ |
private string streetName; |
private string houseNumber; |
[FieldAlias("streetName")] |
public string StreetName |
{ |
get { return streetName; } |
set { streetName = value; } |
} |
[FieldAlias("houseNumber")] |
public string HouseNumber |
{ |
get { return houseNumber; } |
set { houseNumber = value; } |
} |
} |
} |
That structure does not seem to be supported, or is there a trick that I can use?
It would be nice if it worked. In my project I have several structs that are hlpers of a certain class, so it would be nice if I wouldn't have to put them in the same namespace as the rest of the entities, but instead isolate them a bit.
Thanks,
Sipke