public IActionResult CreateNew(int blogId) { // generez o sectiune noua default si o deschid var newSect = new Sections() { Name = "Temp" }; var newLegatura = new BlogsSections() { BlogId = blogId, }; return(SeeDetailsOfSection(_unit.Sections.GetLastInsertedId())); }
public int AddSection(string name, long blogId) { return(ExecuteInTransaction(unit => { var newSect = new Sections() { Name = name, IsSystemCreated = false }; unit.Sections.Insert(newSect); var newBlogSect = new BlogsSections() { BlogId = blogId, Section = newSect }; unit.BlogsSections.Insert(newBlogSect); return unit.Complete(); })); }