Hi,i'm studying last dnn innovations and dal2.
I read some blog posts from dnn experts on this argument, but i can't find other documentation on this, so I hope someone can help me here.
I've an info class like this:
[TableName("mwOfficies")]
[PrimaryKey("OfficeID")]
[Scope("ModuleID")]
[Cacheable("Offices", CacheItemPriority.Default, 20)]
public class OfficeInfo
{
public int OfficeID { get; set; }
public int ModuleID { get; set; }
public string Name { get; set; }
public int OfficeTypeID { get; set; } //Linked table
[IgnoreColumn]
public string OfficeEmail { get; set; }
public DateTime OfficeOpened { get; set; }
}
Created a Controller class to get data:
public static IEnumerable<OfficeInfo> GetCurrentOffices(int moduleId, int status)
{
IEnumerable<OfficeInfo> offices;
using (IDataContext context = DataContext.Instance())
{
var repository = context.GetRepository<OfficeInfo>();
offices = repository.Find("WHERE ModuleID = @0 " +
"AND (FK_STATO < @1)", moduleId, status);
}
return offices;
}
now I've those questions:
1) in dnngrid I used MyController.GetCurrentOffices(ModuleID, 3) as dnngrid datasource, but i can see only 20 results as dnngrid.pagesize = 20, but no pager is displayed
2) I've a Linked column (you can see the property OfficeTypeID) on a Type SQL table where i need to map Office.TypeID = Types.ID and get the OfficeType name to display on dnngrid. How i can do this on DAL2?
the announcements module source code isn't a good start, it has only one table :(