This question is locked. New answers and comments are not allowed.
Hi,
in SQL Server there is an description property (in sys.extended_properties) of tables, columns (which I very much like :) ) and since I'm using OpenAccess fluent mapping api for defining my database model - is there a way to set the values of these 'MS_Description' fields in OpenAccess code-first way of modeling my database?
Sasa
in SQL Server there is an description property (in sys.extended_properties) of tables, columns (which I very much like :) ) and since I'm using OpenAccess fluent mapping api for defining my database model - is there a way to set the values of these 'MS_Description' fields in OpenAccess code-first way of modeling my database?
Regards,
Sasa
3 Answers, 1 is accepted
0
Hi Sasa,
Unfortunately, OpenAccess does not currently support out of the box manipulation of extended properties or other metadata fields. Thus I would offer you to vote for this feature request, which would help us to eventually decide to implement such functionality based on the interest show towards it.
You can still work with extended properties by taking advantage of our context method for executing stored procedures and SQL statements in conjunction with the following stored procedures: sp_addextendedproperty, sp_updateextendedproperty, sp_dropextendedproperty. In case you want to also retrieve extended properties, you could make use of the methods described in this MSDN article. Note that this approach is considered a workaround and may prove inefficient in complex scenarios.
Please find attached a sample project which demonstrates adding, updating and removing extended properties via the aforementioned stored procedures. Retrieving the properties is achieved by using the table valued function fn_listextendedproperty. The sample will create a simple database with a single table Customer: ID, Name, Email, DateCreated.
In order to deploy the sample you will have to:
- Extract the project.
- Open the solution in VisualStudio
- Upgrade OpenAccess references.
- Add you connection string to the .config files in both projects - CustomerModel and ManipulateExtendedProperties.
- Change the value of the connectionStringName variable with the name of your connection string. The variable is located in project CustomerModel, file FluentModel, class CustomerModelContext.
- Select ManipulateExtendedProperties as the start project
- Uncomment the methods according to the scenario you wish to explore
- Run the project in debug mode
Please note that when retrieving the properties, their SQL type is sql_variant and its respective C# CLR type is Object.
I hope this information was helpful to you. In case you have additional questions, do not hesitate to contact us again.
Regards,
Kristian Nikolov
Telerik
Unfortunately, OpenAccess does not currently support out of the box manipulation of extended properties or other metadata fields. Thus I would offer you to vote for this feature request, which would help us to eventually decide to implement such functionality based on the interest show towards it.
You can still work with extended properties by taking advantage of our context method for executing stored procedures and SQL statements in conjunction with the following stored procedures: sp_addextendedproperty, sp_updateextendedproperty, sp_dropextendedproperty. In case you want to also retrieve extended properties, you could make use of the methods described in this MSDN article. Note that this approach is considered a workaround and may prove inefficient in complex scenarios.
Please find attached a sample project which demonstrates adding, updating and removing extended properties via the aforementioned stored procedures. Retrieving the properties is achieved by using the table valued function fn_listextendedproperty. The sample will create a simple database with a single table Customer: ID, Name, Email, DateCreated.
In order to deploy the sample you will have to:
- Extract the project.
- Open the solution in VisualStudio
- Upgrade OpenAccess references.
- Add you connection string to the .config files in both projects - CustomerModel and ManipulateExtendedProperties.
- Change the value of the connectionStringName variable with the name of your connection string. The variable is located in project CustomerModel, file FluentModel, class CustomerModelContext.
- Select ManipulateExtendedProperties as the start project
- Uncomment the methods according to the scenario you wish to explore
- Run the project in debug mode
Please note that when retrieving the properties, their SQL type is sql_variant and its respective C# CLR type is Object.
I hope this information was helpful to you. In case you have additional questions, do not hesitate to contact us again.
Regards,
Kristian Nikolov
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
0
Allen
Top achievements
Rank 1
answered on 06 Jan 2015, 11:34 AM
hi, Kristian Nikolov.
Please See http://www.telerik.com/forums/sql-tables-and-columns-description#3txhIcJyqUOtXG-sMAhehw.
Thank
Please See http://www.telerik.com/forums/sql-tables-and-columns-description#3txhIcJyqUOtXG-sMAhehw.
Thank
0
Hi Allen,
You are welcome to post your feature suggestions in our Ideas and Feedback portal.
There other clients will be able to see your suggestion, comment and vote for it if they want to support it.
Regards,
Viktor Zhivkov
Telerik
You are welcome to post your feature suggestions in our Ideas and Feedback portal.
There other clients will be able to see your suggestion, comment and vote for it if they want to support it.
Regards,
Viktor Zhivkov
Telerik
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.