public ContentResult NotesCount() { var entity = Lite.Parse <Entity>(Request["key"]); int count = NoteWidgetHelper.CountNotes(entity); return(Content(count.ToString())); }
static IWidget WidgetsHelper_GetWidget(WidgetContext ctx) { Entity ie = ctx.Entity as Entity; if (ie == null || ie.IsNew) { return(null); } if (!Types.Contains(ie.GetType())) { return(null); } if (!Finder.IsFindable(typeof(NoteEntity))) { return(null); } return(NoteWidgetHelper.CreateWidget(ctx)); }