public async Task <int> CreateAudioBook(AudioBook model) { // todo: validate //add to context _context.AudioBooks.Add(model); await _context.SaveChangesAsync(); return(model.Id); }
public async Task <int> CreateAuthor(LookupItemModel model) { // todo: validate var author = _mapper.Map <Domain.Author>(model); _context.Authors.Add(author); _cache.Remove(CacheKeys.Authors); await _context.SaveChangesAsync(); return(author.Id); }