Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Active")] Activities activities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(activities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(activities));
        }
Example #2
0
        public async Task Add(ETask task)
        {
            task.DateOfCreation = DateTime.Now;
            task.DateOfUpdate   = DateTime.Now;
            var result = await _projectCoreContext.Task
                         .FirstAsync();

            await _projectCoreContext.Task.AddAsync(task);

            await _projectCoreContext.SaveChangesAsync();
        }