Ejemplo n.º 1
0
        public async Task<int> CreateAsync(Sage sage)
        {
            _context.Sages.Add(sage);

            await _context.SaveChangesAsync();

            return sage.Id;
        }
Ejemplo n.º 2
0
        public async Task<IHttpActionResult> Post(Sage sage)
        {
            if (!ModelState.IsValid) 
            {
                return this.BadRequest(ModelState.ToValidationMessages());
            }

            await _sageService.UpdateAsync(sage);

            _logger.Info("Sage " + sage.Name + " [id: " + sage.Id + "] updated by " + _userHelper.UserName);

            return Ok();
        }
Ejemplo n.º 3
0
 public async Task UpdateAsync(Sage sage) 
 {
     await _sageCommand.UpdateAsync(sage);
 }
Ejemplo n.º 4
0
 public async Task<int> CreateAsync(Sage sage)
 {
     return await _sageCommand.CreateAsync(sage);
 }
Ejemplo n.º 5
0
        public async Task UpdateAsync(Sage sage)
        {
            _context.Entry(sage).State = EntityState.Modified;

            await _context.SaveChangesAsync();
        }