public async Task <ActorDetailedDTO> CreateAsync(ActorCreateUpdateDTO actor) { var entity = new Actor { Name = actor.Name }; _context.Actors.Add(entity); await _context.SaveChangesAsync(); return(await FindAsync(entity.Id)); }
public async Task <bool> UpdateAsync(ActorCreateUpdateDTO actor) { var entity = await _context.Actors.FindAsync(actor.Id); if (entity == null) { return(false); } entity.Name = actor.Name; await _context.SaveChangesAsync(); return(true); }