1. Roland Smith
  2. SnapDevelop
  3. Thursday, 17 June 2021 15:29 PM UTC

SnapDevelop 2019-R3

 

I am doing the 'Create a Web API' tutorial. I did the step 'Add a Service' which adds a "Service (.NET Datastore)" called DepartmentService.


In DepartmentService.cs there are two errors indicated in the generated code.

 

Line 7:

using DWNet.Data;

The type or namespace name 'DWNet' could not be found...

 

Line 34:

if (department.Count == 0)

Operator '==' cannot be applied to operands of type 'method group' and 'int'

 

How do I correct these errors?

Accepted Answer
Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Thursday, 17 June 2021 15:35 PM UTC
  2. SnapDevelop
  3. # Permalink

Hi Roland!

For the first error, you might wanna install the DWNet nuget packages:

Right-click on the project/Manage NuGet Packages/Browse Tab and then search for DWNet. Install both packages that come up. That should fix the error

I hope this helps

Regards,
Francisco

Comment
  1. Francisco Martinez @Appeon
  2. Thursday, 17 June 2021 17:04 PM UTC
I just triple checked, the documentation is ok, I got mixed up there for a bit.

Roland, yes, you will need to install the packages in every project.
  1. Helpful
  1. Roland Smith
  2. Thursday, 17 June 2021 17:55 PM UTC
It would be helpful if the tutorial had NuGet as a step.
  1. Helpful
  1. Francisco Martinez @Appeon
  2. Thursday, 17 June 2021 17:57 PM UTC
Yes, I already suggested that to the team, thank you!
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.