EF Code First hosting - asp.net

What's my options (and where) for hosting a asp.net 4.5 on a hosting service?
I want to use the built-in membership tables + to be able to create automatically a new
database using EF Code First 5
I want easy deploy
Is it good option for Code First in production? I read a lot "Development only", but it's
bother me , why to have Code First if its only for development...
Update :
My main question is even about asp.net 3/4 Code-First , what known hosting services allow you easy deploy with the enjoy of CodeFirst , meaning , auto create database and etc...

Well, your options are at the moment very limited. Firstly, as far as I know, 4.5 hasn't been released yet, so I'm not sure what hosting solutions are you actually expecting. I've heard of some testing hostings for beta version, but.. Don't know about you, but it just won't suffice for my production apps.
Secondly, code-first is meant for rapid development.
You must understand, that "code-first" is just a different way of creating your db classes in .NET. It's still Entity Framework, so if it suits you, it doesn't matter when and how you use it. Background layer is still the same as if you used "classical" auto-generated classes representing your db.

It's only depend on .NET Framework 4.0.
It's very easy to deploy.

Related

Upgrade path for .net Membership

I support a legacy webforms application with SQL backend and have been trying to upgrade it bit by bit
I have upgraded to .NET 4.6 (highest the hosting provider allows), added some jQuery, EF 6 goodness, refactoring in general and attempting to switch to code first from database first edmx, my next plan is to start creating new features using some kind of front end library like Vue.
But...
My problem at the moment is Membership.
It is used throughout the code and statements like
new Guid(Membership.GetUser().ProviderUserKey.ToString())
are literally too many to bear.
And the database has 10 tables and 9 views for it.
vw_aspnet_Applications
vw_aspnet_MembershipUsers
vw_aspnet_Profiles
etc..
The application is using it for authentication and for keeping track of which user is doing what.
Is there a way to upgrade that to a modern solution without much hassle?
I can take the effort out of my own time but I'd prefer a solution that is not overkill.
the amount of users is probably less than 20 so the alternative doesn't have to be complex.
It just has to support most of what Membership is doing.
I've played with Auth0 for a bit in my own time but it seems to be not suited for this.
There is MS Identity as well but I'd prefer to take advice before going into a rabbit hole.
Thanks!
Definitely no simple upgrade. Here's what we did in our case.
Created ASP.NET Identity tables. We made it similar to Membershipusers table and later migrated the whole table.
Added ApplicationUser, ApplicationRole,ApplicationUserManager , ApplicationSignInManager, ApplicationDbContext
Implements Autofac for DI defined at Startup.cs.
Worked on Login/Signup Controller classes.
Finally migrated the whole Membership DB to new aspnetusers table.
Application was initially designed using NOPCommerce (asp.net webforms) and its was relieve to replace Membership.GetUser().ProviderUserKey.ToString() to User.Identity.GetUserId()
Hassle free ? Do you mean easy path (or) scalable path ?
Design is more an opinion rather than objective. It's mostly based on the facts one know about the problem statement. Based on your's i would recommend the following.
Separate all the membership related code into a library (if not already done)
Now write interfaces that will abstract the actual authentication mechanism from the member ship related code in your project. That way your code doesn't need to be changed for any authentication related mechanism. This wouldn't also require change of database schema.
Now for real authentication use something like Auth0 (https://auth0.com/blog/add-auth-to-native-desktop-csharp-apps-with-jwt/) something like this will be easy to implement. But i don't know if your's is a commercial project / how the licensing will work. I know there is a free version for auth0, but i request you to check it out.

How to separate configurations in ASP.NET?

My team is doing web development (ASP.NET, WCF), and we are at a beginning stage where everyone needs to make DB changes and use own sample data.
We use a dedicated DB server, and we want each developer to develop against separate DB.
What we appear to need is ability to configure connection string on per-developer basis in source controlled way. Obviously, we might have other configuration settings that need custom setting and finally, we'll need to maintain a set of configuration settings that are common to all developers.
Can anyone suggest a best practice here?
PS Similar issue appears when we want to deploy a built application to different environments (test, stage, production) without having to manually tweak configurations (except perhaps configuring the environment name).
You can use config transforms for your deployment to different environments. That's easy enough. Scott Hanselman did a pretty awesome video on it here.
For your individual developer db problem, there isn't any particularly elegant solution I can think of. Letting each developer have a unique configuration isn't really a "best practice" to begin with. Once everyone starts integrating their code, you could have a very ugly situation on your hands if everyone wrote their code against a unique db and configuration set. It almost guarantees that code won't perform the same way for two developers.
Here is what I would recommend, and have done in the past.
Create a basic framework for your database, on one database on your test db server.
Create a Database Project as part of your solution.
Use .Net's built in Schema Compare to write your existing database to the database project.
When someone needs to change the database, first, they should get latest on the Database project, then make their changes, and then repeat step 4 to add their changes to the project.
Using this method, it is also very easy for developers to deploy a local instance of the database that matches the "main" database, make changes, and write those changes back to the project.
OK.
Maybe not so elegant solution, but we've chosen to read connection string from a different place when the project is built using Debug configuration.
We are using registry, and it has to be maintained manually.
It requires some extra coding, but the code to read the registry is only compiled in debug (#if debug), so there is no performance hit in production.
Hope this helps as well.
Cheers
v.

Is FluorineFX mature enough to use for a large web application?

I am in the planning stages of developing a large web application written in Flex and was wondering if anyone has actually used FluorineFX in a large production environment?
The documentation and online community makes it seem like it could be abandoned in the years to come and I have yet to read about it being used in production.
I have been assessing Weborb as well, but the costs are extremely high and I'm not entirely satisfied with the general workflow/setup of it. Are there any other solutions out there that I should consider?
I've used FlourineFx with great success in a large product with a Flex 3 client, and it actually works better than the ColdFusion (Adobe LiveCycle) product it replaced. It does require some configuration to work correctly, but it seems to work quite well once your config files are set up -- then again, its the same config files that Adobe LiveCycle need.
Not sure about FlourineFX. It looks like it is either just getting started or ending.
Working with DotNet and Flex, I would recommend writing the Flex Client and using ASP.NET web services to communicate. Microsoft ASP.NET MVC is a wonderful framework that is free and well supported. See: http://www.asp.net/mvc
The advantage of using a web service is that the client can change so that if you decide against Flex in the future or decide to use a Mobile Client then the service will remain the same. Plus, ASP.NET MVC has been proven on some very large sites like SO here.
Hope this helps.

What is better for my ASP.NET project using (Server explorer) or DBconnect class?

I have ASP.NET project and I want to know what is better to use.
ODBC connection and with Server Explorer (drag and drop make DataSet and modify it) or do some DBconnect class with connection to database, queries and use it for GridView?
When I use server explorer, I don't have good feeling because all logic is on aspx page and I do not separate from the application layer logic layer.
It will be a lagre application, databese(PostreSQL) have 18 tables and difficult constraints and application have to generate some documents etc. .
"Better" depends entirely on your situation. Is the purpose to get something done as quickly as possible for internal users at your company, or is this going to be a commercial site that will need to be highly extensible and needs to be as easy as possible to maintain? Will you need to integrate with other platforms possibly built using other languages at some point? The answers to all of these questions should affect your decision.
If you're looking to separate your project into distinct layers, then I would recommend an ORM such as NHibernate or Entity Framework (there are other commercially available ORM products out there, but these are the ones I'm familiar with and which you can easily get help with on this site).
Create a DataSource with LINQ to Entity. It let you the liberty of LINQ with the peace of mind of when you change something il will break your build so you will be able to debug more efficiently.
Well if you have total flexibility, I would recommend using C# ASP.NET 4 with MVC3 razor for the UI and application code. Use Entity Framework 4.1 code first for the data access layer.
This way you will always work with real objects that you create, and with List<realtype> instead of the total mess that exists with datasets.

Is Eloquera or db4o better suited for my web application?

I'm considering using an object oriented database in Visual Studio .NET for my web application, which is basically a web store.
Which should I consider, Eloquera or db4o? Can I have some fresh perspective?
A similar question was asked like 10 months ago - please also mention changes since then.
The features that I consider important are:
Ease of integration into web application project.
Ease of querying using LINQ.
Ease of deployment upon release in IIS server.
Multi user support.
Looks like db4o could be a fit for your needs, but that depends on two factors:
If you're going to host your web store on a hosting provider db4o won't work in a limited trust environment
Depending on the number of simultaneous users, db4o could be a fit or not. As a rule of thumb I would say that if you're talking about more than 50 users hitting the db at the same time, then you should look at other options (one example: Versant Object Database).
Disclosure: I work for Versant and db4o.
Another option would be RavenDb -- it is more of a document database than an object database but it satisfies your requirements by and large:
Easy Integration: insanely easy; use nuget
Easy Linq: linq is the query platform
Easy for IIS: pretty much set up an application pointed there and you are done
Multi-User: yup.
I suggest Eloquera. All the pros of db4o (and more), less some cons...
Real World Experience of db4o and/or Eloquera Database
Eloquera is multihreaded, in opposite to db4o. So, if you expect more that a single visitor to your website, Eloquera is an obvious winner here.
Moreover, Eloquera provides the object-oriented and document-oriented APIs, which can be used together.

Resources