C # XML documentation Linq to SQL

How to document classes and properties and functions generated automatically using LINQ to SQL DBML?

I managed to provide documentation to the datacontext class, specifying the same partial class in another file with <summary> so that it would not be deleted if DBML was updated

 /// <summary> /// Linq to SQL datacontext /// </summary> public partial class LinqDBDataContext { } 

This will work for the table mapping class with one drawback, which must manually support a separate class for added / deleted tables.

one more thing. I have comments similar to the documentation (author, date and description) in the stored procedure, should I also not extract it into the code file as function documentation?

 -- ============================================= -- Author: <Katia Aleid> -- Create date: <2015-04-01> -- Description: <Performs search for the users> -- ============================================= ALTER PROCEDURE [dbo].[SearchUsers] .... 

Is it acceptable to exclude C ++ DBML documentation and have separate database documentation?

+6
source share
1 answer

Comments within the stored procedure are unlikely to be processed by SqlMetal; when clicked, it could access the extended MS_Description metadata if you assigned some — however, I would not expect it to do so. Looking into the dbml metadata, there is nothing obvious for storing or editing additional comments, so to be honest, I suspect the answer is here: you are not doing this. You do not have to edit *.designer.cs because it can be regenerated arbitrarily.

+1
source

Source: https://habr.com/ru/post/985108/


All Articles