private Service MapEntityToService(Entity.Service eService) { var service = new Service(); if (null != eService) { service.ServiceCode = eService.ServiceCode; service.ServiceName = eService.Name; service.ServiceFee = eService.Fee; } return(service); }
private Entity.Service MapServiceToEntity(Service service) { var eService = new Entity.Service(); if (null != service) { eService.ServiceCode = service.ServiceCode; eService.Name = service.ServiceName; eService.Fee = service.ServiceFee; } return(eService); }
public IHttpActionResult addService([FromBody] Entity.Service serviceDetails) { string response = null; IUnityContainer container = new UnityContainer(); ServiceBL serviceBl = new ServiceBL(container); try { response = JsonConvert.SerializeObject(serviceBl.AddService(serviceDetails)); } catch (Exception ex) { var objErr = new ErrorClass(ex, ""); objErr.LogException(); } return(Ok(response)); }