コード例 #1
0
        public async Task <int> AddGroupAsync(GroupDto groupDto)
        {
            if (groupDto == null)
            {
                throw new ArgumentNullException($"Argument {nameof(groupDto)} can't be null!");
            }

            int id = context.Set <Group>().Add(groupDto.ToGroup()).Id;

            await context.SaveChangesAsync();

            return(id);
        }