Store data in DynamicData
I Created a new DynamicData Table ‘VVNInfo’ as showed below.
Hello H.J.E. Coppen,
Thank you for using our services.
The Fluent API does not support working with Dynamic Data in terms of instantiating items and saving them in the database. Support for this will come with the Release Candidate, planned to for release in October.
Kind regards,
Radoslav Georgiev
the Telerik team
Is there, for the meantime, a other way to connect to this data table by the dataprovider of Sitefinity.
Hi H.J.E. Coppen,
Unfortunately there a no Native API methods exposed for working with dynamic data either. This means that for the purposes of working with the dynamic data you need to create a MetaDataProvider which inherits from the OpenAccessMetaDataProvider class and implement the CreateItem methods. Right now those methods are not supported. We are planning a release by the end of this month and we are planning to implement this in the FluentAPI.
Sincerely yours,
Radoslav Georgiev
the Telerik team
Radoslav,
Any update on the next release with the Fluent API being able to manipulate DynamicData tables? If not would it just be best to use OpenAccess as I normally would and create a DataModel?
I had a similar thread going, http://www.sitefinity.com/devnet/forums/sitefinity-4-x/sdk/fluent-api-and-dynamicdata.aspx, which I was pointed to this one from.
Thanks!
Hi Garry Clark,
Thank you for joining the conversation.
We still have much work to do with the dynamic data and is not yet ready for use. Once we have it polished up we will update our documentation with samples on how to work with it.
Regards,
Radoslav Georgiev
the Telerik team
So, is this still not ready to use in RC?
Hello Bill,
There is a DynamicFieldsFacade that you can use
Regards,
Ivan Dimitrov
the Telerik team
Hello,
I have the same problem with the "How to create a module" tutorial.
Here is the visual studio compilator message: 'Telerik.Sitefinity.Libraries.Model.Document does'nt contains a definition for SetValue...". Do I need to insert an assembly reference?
Is this is now available in RC? My RC4 version is dated from 22 november 2010. I need this works for my project because we start with RC. Is there any walkthrough? Have you some examples?
Regards
Jocelyn PAYNEAU
Hi jocelyn,
SetValue is a data extension. Please make sure that you have reference to Telerik.Sitefinity.Model
Name: | Telerik.Sitefinity.Model.DataExtensions |
Assembly: | Telerik.Sitefinity.Model |
Just add using
using Telerik.Sitefinity.Model;
it`ll work!
Is there a example how to use DynamicFieldsFacade? So how do I store Data in a dynamic created table (VVNInfo).
App.WorkWith()
.DynamicData()
.Type()
.CreateNew("VVNInfo", "Telerik.Sitefinity.DynamicTypes.Model")..............
Hi,
Here is a sample that create a new field for NewsItem and then set it
App.WorkWith().DynamicData().Type(
typeof
(NewsItem)).Field().CreateNew(
"somevalue"
,
typeof
(
string
)).SaveChanges();
var itm = App.WorkWith().NewsItems().Where(ni => ni.Title ==
"test"
).Get().SingleOrDefault();
itm.SetValue(
"CustomFiledName"
,
"someValue"
);
Hi,
I created a new table ("VVNInfo"). So I need to get Type("VVNInfo")?
Hi,
I am not sure how creating the table is related to the dynamic type. You should have a type that implements IDynamicFieldsContainer. This is the requirement to use DynamicData
.
You can use DynamicData
with types like NewsItem, ContentItem, EventItem etc.
Best wishes,
Ivan Dimitrov
the Telerik team