Background: I have already written a CLR Database Project which holds all the Business Logic for a Data-Store I'm creating. It is deployed on my SQL Server where it is referenced by various CLR StoredProcedures which take care of data imports. Now I'm working on the Web Frontend and have for this purpose started writing an MVC3 Project. Since I already have the complete Business Logic(object definitions, quality checks) I want to use the code in my MVC Application.
I figured the best way to do this is to add the BusinessLogic CLR Project to my MVC Solution and referenced it in the MVC project. That works fine, and I can use the Code. With some patience I get through most difficulties.
Issues:
1) When I want to debug the MVC solution, Visual Studio always wants to deploy the CLR Assembly. I get around this by unloading the CLR Project in the MVC solution before debugging.
2) Getting a UserDefinedType Reference from my SQLServer also seems to be a problem:
3) I deploy the same code twice on my Server, once with the SQL Assemblies, and once with my MVC frontend.
Question:
- Is there a best-practice for using the same Code in SQL Server Assemblies as well as in the Frontend Project? Maybe a way to reference the deployed BusinessLogic assembly on the SQL Server? Any changes in Business Logic should be accessible both to front-end code as well as to DataImport stuff on the SQL Server. The current solution doesn't feel right, since I have to deploy the same code 2x on my Server, once with the SQL Assemblies, and once with my MVC frontend.
Any partial answers(i.e. glimmers of making sense) would be appreciated. I'm pretty much on my own with this.