Carrotware.CMS.Core.CannedQueries.GetWidgetDataByRootAll C# (CSharp) Method

GetWidgetDataByRootAll() static private method

static private GetWidgetDataByRootAll ( CarrotCMSDataContext ctx, Guid rootWidgetID ) : IQueryable
ctx CarrotCMSDataContext
rootWidgetID Guid
return IQueryable
        internal static IQueryable<carrot_WidgetData> GetWidgetDataByRootAll(CarrotCMSDataContext ctx, Guid rootWidgetID)
        {
            return (from r in ctx.carrot_WidgetDatas
                    where r.Root_WidgetID == rootWidgetID
                    select r);
        }

Usage Example

Ejemplo n.º 1
0
        public void DeleteAll(Guid rootWidgetID)
        {
            IQueryable <carrot_WidgetData> w1 = CannedQueries.GetWidgetDataByRootAll(db, rootWidgetID);

            carrot_Widget w2 = CompiledQueries.cqGetRootWidget(db, rootWidgetID);

            bool bPendingDel = false;

            if (w1 != null)
            {
                db.carrot_WidgetDatas.BatchDelete(w1);
                bPendingDel = true;
            }

            if (w2 != null)
            {
                db.carrot_Widgets.DeleteOnSubmit(w2);
                bPendingDel = true;
            }

            if (bPendingDel)
            {
                db.SubmitChanges();
            }
        }