示例#1
0
 public static Object getAllCategory(Db.Category.CategoryDb.tbCategory y)
 {
     try
     {
         if (y.tbCategories.Count() != 0)
         {
             return(y.tbCategories.Select(x => new { x.Id, x.Name, x.ParentId, x.Description, Childrents = getAllCategory(x) }));
         }
     }
     catch (Exception)
     {
     }
     return(new List <Object>());
 }
示例#2
0
 partial void DeletetbCategory(tbCategory instance);
示例#3
0
 partial void UpdatetbCategory(tbCategory instance);
示例#4
0
 partial void InserttbCategory(tbCategory instance);
示例#5
0
 private void detach_tbCategories(tbCategory entity)
 {
     this.SendPropertyChanging();
     entity.tbCategory1 = null;
 }
示例#6
0
 private void attach_tbCategories(tbCategory entity)
 {
     this.SendPropertyChanging();
     entity.tbCategory1 = this;
 }
示例#7
0
        public static List <Db.Category.CategoryDb.tbCategory> GetChild(CategoryDbDataContext context, Db.Category.CategoryDb.tbCategory category)
        {
            var data = new List <Db.Category.CategoryDb.tbCategory>();

            foreach (var item in category.tbCategories)
            {
                data.Add(item);
                data.AddRange(GetChild(context, item));
            }
            return(data);
        }