public async Task <ServiceResult <ProductRequestViewModel> > GetSingle(int id) { var model = await _repository.GetSingleAsync(id); if (model == null) { return(ServiceResultFactory.Success <ProductRequestViewModel>(null)); } var viewModel = new ProductRequestViewModel { ProductName = model.Name, Code = model.Code, EanCode = model.EanCode, ProductGroupId = model.ProductCategoryId, Description = model.Description, SellingPriceBruto = model.Price, VatPercent = model.Vat, Type = model.ProductType, Unit = model.Unit, UseProductVat = model.UseProductVat }; return(ServiceResultFactory.Success(viewModel)); }