Я сначала использую код Entity Framework 4.3.1 с явными переходами. Как добавить описания для столбцов либо в классы конфигурации сущности, либо в связи с миграциями, так что они заканчиваются как описание столбца на SQL-сервере (например, 2008 R2)?
Я знаю, что, возможно, я могу написать метод расширения для класса DbMigration
, который зарегистрировал бы вызов процедуры sp_updateextendedproperty
или sp_addextendedproperty
в качестве операции миграции sql внутри транзакции миграции и вызвал бы это расширение после создания таблицы в процессе миграции Up
. Но есть ли элегантный способ, который мне еще предстоит открыть? Было бы неплохо иметь атрибут, который логика обнаружения изменений миграции может собирать и генерировать соответствующие вызовы методов в миграции подкладок.