public int Create(CharacterCreateUpdateDTO character) { var entity = new Character { ActorId = character.ActorId, Name = character.Name, Species = character.Species, Planet = character.Planet, }; _context.Characters.Add(entity); _context.SaveChanges(); return(entity.Id); }
public bool Delete(int characterId) { var entity = _context.Characters.Find(characterId); if (entity == null) { return(false); } _context.Characters.Remove(entity); _context.SaveChanges(); return(true); }