public async Task <int> SaveRover(Rover.Domain.Rover rover) { var persistenceRover = Mapper.Map <PersistenceRover>(rover); _context.Rovers.Add(persistenceRover); return(await _context.SaveChangesAsync()); }
public async Task <int> UpdateRover(Rover.Domain.Rover rover) { var persistenceRover = _context.Rovers.First(t => t.Id == rover.Id); persistenceRover.Point = new Point(rover.Point.XPosition, rover.Point.YPosition); return(await _context.SaveChangesAsync()); }
public async Task <int> UpdateRover(Rover.Domain.Rover rover) { var persistenceRover = _context.Rovers.Include(t => t.Plateau).First(t => t.Id == rover.Id); persistenceRover.Point = rover.Point; persistenceRover.Direction = rover.Direction; persistenceRover.PlateauId = rover.PlateauId; persistenceRover.IsLocked = rover.IsLocked; return(await _context.SaveChangesAsync()); }