1. Dan Harrel
  2. .NET DataStore
  3. Monday, 21 December 2020 19:13 PM UTC

I have generated C# Models (POCO objects) from DataWindows which I use in a SnapDevelop Web API project.  I am wondering what the best practice is to use these POCO objects in my Xamarin .NET mobile app client project.  They are needed in the client project for messaging to the Web API.  

One way to do this is to copy the POCO objects into the Xamarin client solution, however they are decorated with attributes that require importing namespaces, including "SnapObjects.Data" and "DWNet.Data".  Do I import these namespaces just so the attributes are recognized? Does it add "weight" to the client project, considering the functionality will not be used?  

Alternatively, should I just strip out the attributes in the client project copies (it would be nice to use the POCO objects as-is without editing)?  Should I compile the POCO objects into a component which is then referenced from both the client Xamarin projects and server Web API project?  

I am new to this technology, and would be grateful for some recommendations.

Thank you!

 

Marco Meoni Accepted Answer Pending Moderation
  1. Tuesday, 22 December 2020 16:41 PM UTC
  2. .NET DataStore
  3. # 1

Hi Dan,

the C# POCO model created by the Model generator includes all data-related properties and attributes, which are required by the C# implementation of the DW. 

In the Xamarin frontend project you don't need Datawindow and .NET Core libs, thereby you should remove the 2 Appeon namespaces and related classes (DwColumn, DwColumnAttribute, etc). Alternatively you might include them in the mobile project as they are managed code, I have never tried this way though.

Best,

.m

Comment
  1. Dan Harrel
  2. Wednesday, 23 December 2020 21:15 PM UTC
Thanks, Marco.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.