Continue developing live windows azure + entity framework code first side - asp.net-mvc

I've worked on ASP.NET MVC site using Entity Framework code first approach.
I've finished my initial website and uploaded it to Windows Azure.
Now, I wish to continue developing the site and enhance the database structure.
The problem is that because it was created as code-first when I'll modify my entities - the database will re-created so my data will be lost.
My questions is - how can I get the live data from windows azure back to my local machine (registered accounts, posts etc.) and how can I continue developing my site without loosing that data. To be more specific - I wish to update the database structure in Azure to the new structure without losing the data inside it. I know about the entity framework DB strategics, but didn't saw anything that saves the data.
Thanks for your help!

Here are instructions for exporting form SQL Azure to blob storage.
http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx#Export
As rjovic said modifying your entities doesn't imply losing data. You can used code first migrations move data from your old entities to your new ones.

Related

Create new MVC app using existing data and EF migrations

I need to port an existing ASP.NET MVC app into a new ASP.NET Core MVC app but I need to maintain the current domain model, EF migrations and data (ultimately I just need the new app to work with the existing database…if I need to start the migrations from start that’s no problem). I can’t find any explanations of how to do this, and from what I’ve read it appears porting from MVC to Core MVC isn’t without it’s traps and pitfalls.

New to Django. Can the admin panel be used as the primary app?

All,
I've searched the forum but I'm sure I'm not searching the right terms.
Apologizes in advance for what I'm sure is a redundant question.
I have a VERY simple single table database that was managed by a foxpro app for a long time. I'm trying to move it to a web based app.
It seems like with a little customization using django-suit, the admin panel for the database really provides everything I would need.
Looking for PROS/CONS if this is appropriate.
Is this a common approach for super simple DB apps?
-Scott
I know nothing about Django so I cannot advise you on that.
I have a VERY simple single table database that was managed by a
foxpro app for a long time. I'm trying to move it to a web based app.
The assumption here is that the data table itself is a Foxpro 'native' data table (a DBF file with perhaps one or more Index files - IDX or CDX and maybe a Memo file - FPT).
However we have created Web based apps which still utilize the Old Foxpro data tables.
We created VB.Net apps which use Foxpro ODBC Connections to/from the old Foxpro data tables from our old legacy system and it works just fine.
Otherwise you will have to re-create your Foxpro data table from scratch into another database of your choice M$ SQL Server, MySQL, Django or whatever and then build your web-centric app around it.
Good Luck

MCV4 And Enitiy Framework. Without been able to directly connect to the database

I have a very strange situation which I am currently faced with. I have been passed a project to uplift a website to use MVC4 & the enitiy framework. However due to the way that the original implementation was undertaken the database access is not direct from the website it's handed to a separate middle-ware application which we pass the name of a sql transaction we would like to have executed & the required parameters, this then returns us a datatable object.
My Question is this Without having to remove this middle-ware process could I create a MVC4 App with the use of the enitiy framework?
You can certainly create an MVC4 app - you'll just have to create a custom model - but I would suggest that even if using EF is possible, it will be more effort than it is worth, and involve too many compromises and hacks.

Converting a project from webforms to MVC over time - can this be done?

I'm working on a typical 3-tiered webforms app backed by a SQL server database. In addition, several of the forms call a DAL layer that gets data from a DB2 database on a host, and this logic is well encapsulated. There are about 80 forms in this project but I'd say at least 50 of them are so similar that they would share the same 2 or 3 views.
So tell me if you think this is a recipe for disaster...I've been asked to explore the possibility of converting this project to MVC in an incremental manner. We would never get the ok from management to take the time just to convert the project in one fell swoop. It would have to be done incrementally within our business-related releases - i.e., we have releases every few months and I've been asked to explore how we could make smaller changes with each release to work our way towards MVC. Since they are 2 totally different frameworks I don't immediately see how this can be done. One idea I have is to carve out the UI piece, put that into an MVC project, and have the controllers call down to the DAL that we have now. Can you even have a solution with different project types in it? Any other ideas?
I have done something similar in recent past. I have a running application developed in ASP .Net and Oracle. That application has several performance issues due to which we have to re factor that. And we all agreed that we should migrate it to MVC at the same time.
So, I created a new project MVCWebClient. In that new project we created our pages one by one. Now user use old application's login page to log into our application and we changed the links which point to our new application.
Everything is working smoothly except session. Because we stored uid/pwd in session, so I created a dummy page which transfer the session parameters to our MVC application.
For example my existing application has following URLS:-
/Login.aspx
/Home.aspx
/Finance/Payslip.aspx
and I created a integration page to transfer session like this
/Integration.aspx?urlRequest=/MVCApp/Finance/Payslip
and my main navigation links become like this
/Login.aspx
/Home.aspx
/Integration.aspx?urlRequest=/MVCApp/Finance/Payslip
Feel free to ask details if you are interested in my solution.

How to work with ASP.NET MVC and ODBC 2.0

I am starting out on a project that will involve ASP.NET MVC using a legacy ODBC 2.0 compliant database. The goal is to replace current system functionality with a web front end over a period of maybe a year then swap out the backend with SQL Server.
The plan would be to code against SQL server then insert some shim into the repository classes to use ODBC instead. Is it even feasible to do this ? Entity Framework doesn't have built in support for ODBC.
Any thoughts or advice would be appreciated.
I personally use NHibernate with MVC. Originally I picked it up because our database doesn't support EF but enjoy it enough that even if we moved to SQL Server I'd keep NHibernate.
The learning curve is kinda weird. It is definitely steep to become an expert, but it is interesting in that it is pretty organic to let it handle more and more of the work for you as you get comfortable with certain layers.
So for your case NHibernate probably supports your database, can be used as a simple data access layer (just returning DTOs), provides a database agnostic interface and can support SQL Server when the time comes. If you end up wanting more out of NHibernate it is there when the time comes.
There's nothing to stop you writing your own data access layer, to query the ODBC Database. You could also make your own entity layer so that the MVC model can populate your entities using the data layer, and return these objects to the controller.
Basically, have a data access and entities layer under your mvc app, then you can replace these entities, with entity framework, or nhibernate entities, at a later date.
This way of doing it means that your MVC app doesn't need to know what database it is using, it also means that you should have an easy time when you switch an entity later.

Resources