# DataContext issue from code generation?

**URL:** <https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317>\
**Category:** Blazor WebAssembly\
**Created:** [July 16, 2022, 7:37pm UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317 "2022-07-16T19:37:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Daniel](https://forum.radzen.com/user_avatar/forum.radzen.com/_daniel/32/8520_2.png) [@\_Daniel](https://forum.radzen.com/u/_Daniel)\
**Post date:** [July 16, 2022, 7:37pm UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/1 "2022-07-16T19:37:51Z")

</div>

When I run the project from Radzen for WA, I'm getting the error

```auto
the type or namespace name 'datacontext' does not exist in the namespace

```

When I go into the project in visual studio I can run 'Sync Namespaces' after right clicking the project and I can rebuild it in VS. And then it will run successfully.

Once I run the project again from Radzen it will generate code and then cause the datacontext issue to occur again.

I'm using 2.69.3 version

**Update: The issue does not occur with Blazor Server Side**

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [July 17, 2022, 5:14pm UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/2 "2022-07-17T17:14:12Z")

</div>

Hi @_Daniel,

What is the name of the data source? Radzen uses it to generate the data context name. You can send us your application to [info@radzen.com](mailto:info@radzen.com) but be aware we have a 10mb size limit of emails.

---

<div class="post-metadata">

**Author:** ![\_Daniel](https://forum.radzen.com/user_avatar/forum.radzen.com/_daniel/32/8520_2.png) [@\_Daniel](https://forum.radzen.com/u/_Daniel)\
**Post date:** [July 23, 2022, 2:28pm UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/3 "2022-07-23T14:28:43Z")

</div>

Hi Korchev, the data context name is workworked.

The full error is:  
`error CS0234: The type or namespace name 'DataContext' does not exist in the namespace 'Workworked.Controllers.Data' (are you missing an assembly reference?)`

![image](https://forum.radzen.com/uploads/default/original/2X/2/2e2b2aeef23ff9d55bfd050d53a2673ac0e97b36.png)

**Edit: I made a new app using blazor server (same db) and the name is workworkedserverside instead and that is working but Ideally I'd want this to work in the webassembly version.**

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [July 23, 2022, 3:22pm UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/4 "2022-07-23T15:22:47Z")

</div>

How is your datasource named in the web assembly application?

---

<div class="post-metadata">

**Author:** ![\_Daniel](https://forum.radzen.com/user_avatar/forum.radzen.com/_daniel/32/8520_2.png) [@\_Daniel](https://forum.radzen.com/u/_Daniel)\
**Post date:** [July 27, 2022, 1:05am UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/5 "2022-07-27T01:05:47Z")

</div>

The datasource is named data

 ![image](https://forum.radzen.com/uploads/default/original/2X/3/3b3722b5484b2e1e90cf9aca2b19bc5fd42c02be.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [July 27, 2022, 5:20am UTC](https://forum.radzen.com/t/datacontext-issue-from-code-generation/11317/6 "2022-07-27T05:20:40Z")

</div>

Issue confirmed! Fix will be published with our next update tomorrow.
