Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you share a class between MAUI and an ASP.NET Web API Service? #1935

Closed
jbendler1 opened this issue Dec 6, 2023 · 2 comments
Closed
Labels
doc-enhancement Improve the current content [org] dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 product-question Product usage related questions [org]

Comments

@jbendler1
Copy link

jbendler1 commented Dec 6, 2023

Type of issue

Missing information

Description

[Enter feedback here]
You talk about it, but how do you share a class between MAUI and an ASP.NET Web API Service?

Page URL

https://learn.microsoft.com/en-us/dotnet/maui/data-cloud/rest?view=net-maui-8.0

Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/data-cloud/rest.md

Document Version Independent Id

851edc00-2289-d52f-106f-0eb968a7792d

Article author

@davidbritch

Metadata

  • ID: 851edc00-2289-d52f-106f-0eb968a7792d
  • Product: dotnet-mobile
  • Technology: dotnet-maui

Associated WorkItem - 194101

@issues-automation issues-automation bot added dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 labels Dec 6, 2023
@davidbritch davidbritch added the doc-enhancement Improve the current content [org] label Dec 18, 2023
@davidbritch davidbritch self-assigned this Dec 18, 2023
@davidbritch davidbritch added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Dec 18, 2023
@github-actions github-actions bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Dec 19, 2023
@davidbritch davidbritch removed the 📌 seQUESTered Identifies that an issue has been imported into Quest. label Dec 19, 2023
@davidbritch davidbritch removed their assignment Dec 19, 2023
@davidbritch davidbritch added the product-question Product usage related questions [org] label Dec 19, 2023
@davidbritch
Copy link
Contributor

Hi @jbendler1

There's nothing special involved in doing this - you just have to duplicate your POCO class in each project. The key point is you can't used any .NET MAUI types in your duplicated class.

@medkane
Copy link

medkane commented Feb 3, 2025

The 2 projects can be holded in the same VS solution and they refer to the same shared project in which you define your models and DTOs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org] dotnet-maui/tech dotnet-mobile/prod Pri1 High priority, do before Pri2 and Pri3 product-question Product usage related questions [org]
Projects
None yet
Development

No branches or pull requests

3 participants