Ejemplo n.º 1
0
        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()));
        }
Ejemplo n.º 2
0
        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();
            }));
        }