コード例 #1
0
        /// <summary>
        /// Добавить доклад (основная информация).
        /// </summary>
        public async Task <Guid> InsertAsync(ReportInnerModel innerModel)
        {
            var report = _mapper.Map <Report>(innerModel);

            report.Id   = Guid.NewGuid();
            report.Path = String.Empty;

            await _db.InsertAsync(report);

            await InsertCollaboratorsAsync(report.Id, innerModel.Collaborators);

            return(report.Id);
        }
コード例 #2
0
        public async Task AttachUserAsync(Guid reportId, string email)
        {
            var user = await _userRepository.GetByEmailAsync(email);

            await _db.InsertAsync(
                new Collaborator { ReportId = reportId, UserId = user.Id });
        }
コード例 #3
0
        public async Task <Guid> InsertAsync(User user)
        {
            user.Id = Guid.NewGuid();
            user.Phone ??= string.Empty;
            await _db.InsertAsync(user);

            return(user.Id);
        }