score:2
I think that replacing MSLinqToSqlGenerator
with something else is the cleanest solution and it might be done in several ways. You could, for example,
Use a tool like T4 Toolbox: LINQ to SQL classes generator or Reegenerator and modify the provided template to suit your needs. That's probably the easiest way.
Generate the code with T4 using a custom template. You will need to create a T4 template which would use XML data from .DBML file. You'd probably need to disable DBML code generation by setting the Custom Tool property to blank. The disadvantage is you will need to run T4 generation each time after modifying .DBML file.
Create a custom tool to generate the code for you using XML data from .DBML file and some templating solution (T4 or XSLT, perhaps). This approach could arguably be the most flexible one, the only disadvantage is that you'll have to use the custom tool on every developers' machine.
I'm not sure what's optimal for your situation, but I'd probably consider using T4 Toolbox first. The T4 template it uses is quite standard and can easily be modified if necessary.
Source: stackoverflow.com
Related Articles
- Linq Mapping dbml - capturing stored proc parms for error reporting
- creating Linq to sqlite dbml from DbLinq source code
- LINQ Source Code Available
- Calling stored proc with LINQ .ExecuteQuery to return non-mapped fields
- Linq or Stored proc - Which should I choose?
- entity framework with linq query and stored expression error
- Linq error while dragging and dropping my table from server explorer to dbml file
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- ASP.Net LINQ data source error is ListView
- Mapping select query to an object makes an error in linq
- Compiling Error with LINQ Sorting Code Using List<T>
- source code for LINQ 101 samples
- selecting a distinct count from LINQ Stored Proc
- Linq to sql stored proc not returning results
- Trouble with a LINQ 'filter' code throwing an error
- error from linq while execting stored procedure from linq
- Converting Stored Proc to LINQ to Entities
- c# Linq or code to extract groups from a single list of source data
- Getting the Error in my code when framing LINQ
- Converting complex sql stored proc into linq
- ASP.NET calling stored proc with LINQ and passing in DataTable
- Generated DBML code incorrectly marks returned columns as NOT NULL for stored procedures
- nullable object must have a value error in linq to sql in vb.net code
- Getting error in LINQ Expression or converting service to client simple mapping
- Reuse stored procedure result in linq to sql in Code First
- Convert string[] to int[] in one line of code using LINQ
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Linq code to select one item
- How are people unit testing code that uses Linq to SQL
- LINQ Lambda Join Error - cannot be inferred from the usage
- How to check for null values before Converting a comma Separated string to Generic List
- LINQ to Datatable Group by and return all columns
- Debugging .NET dynamic methods
- Using PageResult in a base ApiController returns a System.ArgumentNullException
- Linq query construction based on empty parameters
- Formatting data with linq into a new object
- How does LINQPad reference other classes, e.g. Books in the LINQ in Action samples
- Merging a decrypted search of items within a LINQ query
- How can I stop an auto-generated Linq to SQL class from loading ALL data?
- How to retrieve multiple rows from a stored procedure with Linq to SQL?
- Remove an element from list inside a list in C#.
- Entity Framework: Join Entities of Different Types and Order by Date
- Is there a way to use linq query with DateTime and a string working together in the same request?
- How to get xml log elements by searching the specific string/text using LINQ
- (Service) program freeze when getting an object from Service
- C# How to use LINQ to grab all cell data under a particular column header name
- Why did my code work when I changed it from IEnumerable to List?
- how to use the lowercase in linq using C# mongodb
- Select XML Element based on another elements value
- Looking for example or tips on how to iterate over a table based on results