public string Add(PingService entity) { if (entity == null) return "No Ping Service was provided."; PingService temp = new PingService {PingUrl = entity.PingUrl}; _context.PingServices.Add(temp); _context.SaveChanges(); _context.Dispose(); return string.Empty; }
public string Update(PingService entity) { if (entity == null) return "No Ping Service was provided."; PingService temp = _context.PingServices.Find(entity.Id); if (temp == null) return "the specified ping service was not found."; temp.PingUrl = entity.PingUrl; _context.SaveChanges(); _context.Dispose(); return string.Empty; }
public PingServiceViewModel MapToView(PingService entity) { return Mapper.Map<PingService, PingServiceViewModel>(entity); }