///// <summary> ///// 更新内容 ///// </summary> ///// <param name="pid"></param> ///// <param name="content"></param> ///// <returns></returns> //public async Task<bool> UpdateContent(Guid pid, string content) //{ // await this._unitOfWork.GetRepositoryAsync<NotesContentEntity>() // .UpdateBach(c => c.PageId == pid // , p => new NotesContentEntity // { // Content = content // }); // this._unitOfWork.SaveChanges(); // return true; //} /// <summary> /// 创建区域 /// </summary> /// <returns></returns> public async Task <NotesObj> CreateSection(Guid noteId, Guid sId, string name) { var notes = await this._loader.LoadAsync(noteId); var sectionEntity = new NotesSectionEntity { Id = sId, NotesId = noteId, Name = name }; notes.AddSection(new SectionValue(sectionEntity)); await this._envSender.SendAsync(new NotesSectionCreated { NotesId = noteId, SectionId = sId, Name = name }); //await this._unitOfWork.GetRepositoryAsync<NotesSectionEntity>() // .AddAsync(sectionEntity); //this._unitOfWork.SaveChanges(); await this._loader.Save(notes); return(notes); // sectionEntity.Id; }
public SectionValue(NotesSectionEntity se) { this.Sections = se; }