Example #1
0
 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;
 }
Example #2
0
 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);
 }