示例#1
0
        public async Task <object> GET(NetworkById request)
        {
            //Expression<Func<ServiceModel.Network, bool>> keySelector = x => x.id == request.id;
            //var networkByID = await _netWorkService.GetById(keySelector: keySelector);
            var network = await _netWorkService.GetById(request.id);

            var response = new BaseResponse();

            response.Message = $"Get network by ID:{request.id} successfully";
            response.Results = network;

            return(response);
        }
示例#2
0
        public async Task <object> DELETE(NetworkById request)
        {
            var response = new BaseResponse();

            //Expression<Func<ServiceModel.Network, bool>> keySelector = x => x.id == request.id;
            //var result = await _netWorkService.Delete(keySelector);

            response.Results = await _netWorkService.Delete(request.id);

            if ((bool)response.Results == true)
            {
                response.Message = "Deleted network successfully";
            }
            else
            {
                response.Message = "Deleted network failed";
            }
            return(response);
        }