internal static Daan ChuangjianDaan(DaanDataModel model) { List<FujianXinxi> fujianList = null; if (!string.IsNullOrEmpty(model.FujianJson)) { fujianList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<FujianXinxi>>(model.FujianJson); } Daan daan = new Daan(model.Id, model.Neirong, fujianList); return daan; }
internal static Daan ChuangjianDaan(string neirong, List<FujianXinxi> fujianList) { DaanDataModel model = new DaanDataModel(); model.Neirong = neirong; if (fujianList != null) { model.FujianJson = Newtonsoft.Json.JsonConvert.SerializeObject(fujianList); } model.Id = (int)NHibernateHelper.CurrentSession.Save(model); Daan daan = ChuangjianDaan(model); return daan; }