من از EF مدلهای خود ارجاع دهنده مثالی که زدید استفاده کردم. حالا چطور باید تو js tree آنرا بخونم؟
۹ سال و ۳ ماه قبل، دوشنبه ۸ تیر ۱۳۹۴، ساعت ۱۹:۳۷
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Text; namespace MvcJSTree.Models.Entities { public class Category { public Category() { } public Category(string id,string parentid,string orginialid,string text,string position,string href) { this.Id = id; this.ParentId = parentid; this.OriginalId = orginialid; this.Text = text; this.Position = position; this.Href = href; } public string Id { set; get; } public string ParentId { set; get; } public string OriginalId { set; get; } public string Text { set; get; } public string Position { set; get; } public string Href { set; get; } public override string ToString() { return string.Format("{0},{1},{2},{3},{4},{5}",this.Id,this.ParentId,this.OriginalId,this.Text,this.Position,this.Href); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Text; using System.Data.Entity; namespace MvcJSTree.Models { public class DataBaseContext:System.Data.Entity.DbContext { public DataBaseContext() { } static DataBaseContext () { System.Data.Entity.Database.SetInitializer( new System.Data.Entity.DropCreateDatabaseIfModelChanges<DataBaseContext>()); } public System.Data.Entity.DbSet<DataBaseContext> Category { get; set; } } }