SQLMetal , Linq and Business Logic location question.
-
Hi, I have inherited an application that was written in VB6, and SQL. The business logic all sits inside stored procedures and triggers in the SQL Server. I am looking at re-writing the interface (WEB and Winforms) in C# (.net 3.5). I have been looking at using ORM to generate a DAL, and thought I would try SQL Metal and LINQ for starters. Due to most of the business logic being in stored procedures, I don't want to mess too much with them, as they are working in the live environment. When I use SQLMetal to generate the class file, it includes all my tables , stored procs etc as I required. I will be using this DAL across 2 main applications, a winforms app and a web app, and there are a few developers going to be using it. I have a good understanding of the database and the related business logic, so I am able to determine when I should be updating the data in the table directly, or whether I should be using a stored proc with custom logic to update /create records. The problem comes in, with other developers who don't know this. Is there a good way for me to disable certain tables / stored procs, as I don't want them all in my code. And is there a way for me to specify which DAL options I want .. i.e. I don't want Insert or Update for some tables. i.e. Table A - generate full DAL code Table B - generate only read DAL code, i.e. disallow the Insert and I will add a method in a partial class handling this. Table C - Do not generate DAL (internal table used only in SQL) It seems strange that I can't specify these types of things with SQLMetal. The database is currently under constant changes, and the DAL will need to be regenerated often, and I don't want to have to remove things that shouldn't be there all the time. Do I stick with SQLMetal or should I look at another ORM tool ? Any suggestions ?
-
Hi, I have inherited an application that was written in VB6, and SQL. The business logic all sits inside stored procedures and triggers in the SQL Server. I am looking at re-writing the interface (WEB and Winforms) in C# (.net 3.5). I have been looking at using ORM to generate a DAL, and thought I would try SQL Metal and LINQ for starters. Due to most of the business logic being in stored procedures, I don't want to mess too much with them, as they are working in the live environment. When I use SQLMetal to generate the class file, it includes all my tables , stored procs etc as I required. I will be using this DAL across 2 main applications, a winforms app and a web app, and there are a few developers going to be using it. I have a good understanding of the database and the related business logic, so I am able to determine when I should be updating the data in the table directly, or whether I should be using a stored proc with custom logic to update /create records. The problem comes in, with other developers who don't know this. Is there a good way for me to disable certain tables / stored procs, as I don't want them all in my code. And is there a way for me to specify which DAL options I want .. i.e. I don't want Insert or Update for some tables. i.e. Table A - generate full DAL code Table B - generate only read DAL code, i.e. disallow the Insert and I will add a method in a partial class handling this. Table C - Do not generate DAL (internal table used only in SQL) It seems strange that I can't specify these types of things with SQLMetal. The database is currently under constant changes, and the DAL will need to be regenerated often, and I don't want to have to remove things that shouldn't be there all the time. Do I stick with SQLMetal or should I look at another ORM tool ? Any suggestions ?
Add new item -> LINQ to SQL classes Drag and drop tables and stored procedures you want from the Server Explorer (or Database Explorer).
Eslam Afifi