c# - Access wrapped object -
i'm wrapping orm entities bussines objects.
public class projectmember { private readonly tfprojectmembersentity _projectmembersentity; public projectmember(tfprojectmembersentity projectmembersentity) { _projectmembersentity = projectmembersentity; } #region props public string email { { return _projectmembersentity.email; } set { _projectmembersentity.email = value; } } public datetime created { { return _projectmembersentity.created; } set { _projectmembersentity.created = value; } } }
this bussines objects returned repository. way out isn't complicated. problem how access wrapped entity when wrapped object passed repository save operation.
what neat way, wrapped object ?
simply add method or property?
you create interface so:
interface iwrappedentity<t> { t getwrappedentity(); }
now make bos implement interface. create base class implementing interface , derive bos base class.
edit:
changed dto entity conform code.
Comments
Post a Comment