Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
Sorry my friends to bother but i'm stuck and really need help with this, please..
I have two class in two different table:
Person
[TableName("dnn7Miguel_Person")]
//setup the primary key for table
[PrimaryKey("Id", AutoIncrement = true)]
//configure caching using PetaPoco
[Cacheable("Person", CacheItemPriority.Default, 20)]
//scope the objects to the ModuleId of a module on a page (or copy of a module on a page)
//[Scope("ModuleId")]
[DeclareColumns]
public class Person
{
[IncludeColumn]
public int Id { get; set; }
[IncludeColumn]
public string LastName { get; set; }
[IncludeColumn]
public string FirstName { get; set; }
[IncludeColumn]
public int AddressId { get; set; }
[IgnoreColumn]
public Address Address { get; set; }
}
and
Address
[TableName("dnn7Miguel_Address")]
//setup the primary key for table
[PrimaryKey("Id", AutoIncrement = true)]
//configure caching using PetaPoco
[Cacheable("Address", CacheItemPriority.Default, 20)]
//scope the objects to the ModuleId of a module on a page (or copy of a module on a page)
//[Scope("ModuleId")]
[DeclareColumns]
public class Address
{
[IncludeColumn]
public int Id { get; set; }
[IncludeColumn]
public string Street { get; set; }
[IncludeColumn]
public string HouseNumber { get; set; }
}
i have some doubts about DAL2: it is possible to insert both class in one query ? how ? which is the best way ?
Last Question; how can i make a SELECT with one query of both class? if is not possible, wich is the best way ?
Thank you very much my friends.
Best regards,
Miguel Moreno