Is it possible to do Phonegap together with Asp.Net MVC 5 in a single project?

Asked

Viewed 124 times

1

I would like to know if there is a possibility of making a Solution in DDD Design with two View Ports, being one for mobile app using Phonegap and the other MVC 5.

I want to make an activity management system that will be accessed by my leaders. You can make inclusions via Intranet or when they have a meeting at Cellular.

I’d like to make a Domain equal for both as per the DDD, but the database know it will be different, using SQL Server and another Javascript database, example Sqlite.

I see many examples saying that this is possible but I have not found a form or hint that can validate this concept.

Could you help me? Thank you!

  • Boy, take it easy. You seem to be asking about things you don’t know and your question seems to be too wide. For starters, MVC only goes up to 2 (you didn’t happen to mean Asp.net-mvc-5 ?)

  • Sorry, this just meant that it was aps.net MVC 5. on the question I do not have same domain of the subject so I asked for help. I’ve done a project in DDD but my leaders want now that this Asp.net MVC 5 works tb for Mobile. I think now I was clear. Sorry.

  • I’ll leave the answer to someone from. net, but, I think it’s better instead of you using sqlite, take advantage of the database / business rules than is already done and chat via REST.

  • I thought very good this tip would have some example Using Rest for Phonegap, my friend said the same thing I’m researching here if I find something I will post to community. Thank you very much.

1 answer

1


I would like to know if there is the possibility of making a DDD Design Solution with two View Ports, one for mobile application using Phonegap and the other MVC 5.

There is. To set your project to multiple View Ports, make sure to invoke the DisplayModeProvider on your system startup, Global.asax.Cs file:

public class MvcApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
        ...

        var displayModes = DisplayModeProvider.Instance.Modes;

        ...
    }
}

Done this, produce your Views to Phonegap using the suffix .Mobile.cshtml. For example, if you want to customize the layout of the system, differentiating the layout of the View Port main of View Port mobile, create two files:

  • /Views/Shared/_Layout.cshtml
  • /Views/Shared/_Layout.Mobile.cshtml

This also applies to any and all View your system: not just for Layout.

Your application already has the ability to detect the User Agent (device browser and device type) and will call the View correct for each case.

I would like to make a domain equal for both according to the DDD, but the database I know will be different, using SQL Server and another Javascript database, example Sqlite.

The part of Models your project already follows the DDD. No additional change is required.

It is not necessary to use two database technologies. Only SQL Server is sufficient to produce what you need.

  • 1

    Thank you very much Gypsy, again always with good answer helping everyone. vlw.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.