public async Task <int> SaveFile(FileModel request)
        {
            var entity = _mapper.Map <Database.FileModel>(request);
            await _context.FileModels.AddAsync(entity);

            await _context.SaveChangesAsync();

            return(entity.Id);
        }
Пример #2
0
        public async override Task <Event> Insert(Model.Insert.Event request)
        {
            Database.Event entity = _mapper.Map <Database.Event>(request);
            _dbContext.Events.Add(entity);
            await _dbContext.SaveChangesAsync();

            await AddAndTrainModel(new FunctFieldEventTimeModel
            {
                FunctionalFieldId = (uint)entity.FunctionalFieldId,
                EventTimeUid      = GetVrijemeUid(entity.DateTime.Hour)
            });

            return(_mapper.Map <Model.Response.Event>(entity));
        }