コード例 #1
0
ファイル: ProviderDirectory.cs プロジェクト: mndarren/Pizza
        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);
        }
コード例 #2
0
ファイル: ProviderDirectory.cs プロジェクト: mndarren/Pizza
        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);
        }
コード例 #3
0
        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));
        }