How can I implement the same models and data across ASP.NET and Windows Apps

79 Views Asked by At

Bit of a beginner question, but I'm currently building an ASP.NET MVC web app and I would like to transfer my models and data across to a Windows Universal App to begin with and then maybe a Xamarin app in the future.

Are there any good tutorials or blog posts out there that anyone can recommend that would help me. The idea is that the user will have the same experience across web and mobile so I don't want to hard code models for each client.

1

There are 1 best solutions below

0
On BEST ANSWER

To do this you will need to split your domain model into different projects.

When you create your MVC application create a new C#/VB.NET assembly and place all of your models in the assembly. This way you can reuse the code across multiple projects.

Keep in mind that you shouldn't just dump code into this assembly take the time and create a proper namespace structure so that you don't confuse yourself or anyone else later on down the road.