public async Task <Group> UpdateAsync(Group group, CancellationToken ct)
        {
            var updatedGroupEntry = _context.Groups.Update(group.ToEntity());
            await _context.SaveChangesAsync(ct);

            return(updatedGroupEntry.Entity.ToService());
        }
Exemple #2
0
        public async Task <Group> AddAsync(Group group, CancellationToken ct)
        {
            var added = _context.Groups.Add(group.ToEntity());
            await _context.SaveChangesAsync(ct);

            return(added.Entity.ToService());
        }
Exemple #3
0
        public async Task <Group> UpdateAsync(Group group, CancellationToken ct)
        {
            try
            {
                var updatedGroupEntry = _context.Groups.Update(group.ToEntity());
                await _context.SaveChangesAsync(ct);

                return(Mapper.Map <Group>(updatedGroupEntry.Entity));
            }
            catch (Exception)
            {
                throw;
            }
        }