I made a class that wraps an IList and implements IList<T>. Now I have a member on my entityclass that looks like this:
IList<Shivam.SugarCube.DAL.Model.IUserRole> Shivam.SugarCube.DAL.Model.IUser.UserRoleUsingUserId{
get{
return (IList<Shivam.SugarCube.DAL.Model.IUserRole>)new Shivam.SugarCube.DAL.Model.ListWrapper<Shivam.SugarCube.DAL.Model.IUserRole>(UserRoleUsingUserId);
}
}
And i should able to add to it without any issues. Now I can deal with my UserEntity (for example) as IUser/
public interface IUser {
// __LLBLGENPRO_USER_CODE_REGION_START UserRoleUsingUserIdAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
IList<IUserRole> UserRoleUsingUserId{ get; }
// __LLBLGENPRO_USER_CODE_REGION_START RoleCollectionViaUserRoleAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
IList<IRole> RoleCollectionViaUserRole{ get; }
// __LLBLGENPRO_USER_CODE_REGION_START UserIdAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.Int32 UserId { get;}
// __LLBLGENPRO_USER_CODE_REGION_START UsernameAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String Username { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START PasswordAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String Password { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START FirstNameAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String FirstName { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START SurnameAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String Surname { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START EmailAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String Email { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START IsActiveAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.Boolean IsActive { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START LastLoginAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.DateTime? LastLogin { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START UpdatedOnAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.DateTime UpdatedOn { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START UpdatedByAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String UpdatedBy { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START CreatedOnAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.DateTime CreatedOn { get;set;}
// __LLBLGENPRO_USER_CODE_REGION_START CreatedByAttributes
// __LLBLGENPRO_USER_CODE_REGION_END
System.String CreatedBy { get;set;}
}