public Guid Add(FolderAddModel model) { FolderModel newFolder = new FolderModel { UserId = model.UserId, Name = model.Name }; if (model.ParentId != Guid.Empty) { newFolder.ParentFolder = context.Folders.Where(x => x.Id == model.ParentId).FirstOrDefault(); } context.Folders.Add(newFolder); context.SaveChanges(); return(newFolder.Id); }
public ActionResult AddFolder(FolderAddModel model) { folders.Add(model); return(Ok()); }