コード例 #1
0
        public void UpdateSubgroup(Subgroup input)
        {
            var user     = _userService.GetCurrentUser();
            var subgroup = _subgroupQueryService.GetSubgroupById(input.Id);

            subgroup.Name           = input.Name;
            subgroup.Description    = input.Description;
            subgroup.LastUpdateDate = DateTime.Now;
            subgroup.LastUpdatedBy  = user.Identity.Name;

            using (var dbContextScope = _dbContextScopeFactory.Create())
            {
                var dbContext = dbContextScope.DbContexts.Get <EntityManagerDbContext>();

                dbContext.Set <Subgroup>().AddOrUpdate(subgroup);
                dbContext.SaveChanges();
            }
        }
コード例 #2
0
        public ActionResult Details(Guid id)
        {
            var subgroup = _subgroupQueryService.GetSubgroupById(id);

            return(View(subgroup));
        }