Current filter:
                                You should refresh the page.
                                  • Hello!

                                    I've managed to get Domain Components working on a oData Data Service. All ok, I tested it on a WebBrowser, and I get the XML describing the types.
                                    But the types come with the full auto generated name, example: DevExpress_ExpressApp_DC_GeneratedClasses_CLASSNAME.

                                    How can I get rid of the prefix "DevExpress_ExpressApp_DC_GeneratedClasses_" and bring the short names (ClassName) only?

                                    The code I used is:

                                    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
                                    public class TheDataService : XpoDataServiceV3
                                    {

                                    public TheDataService() : base(new MyContext("XpoContext", "TheNamespace", CreateDataLayer())) { }

                                    static IDataLayer CreateDataLayer()
                                    {
                                    XpoTypesInfoHelper.ForceInitialize();
                                    var typesInfo = XpoTypesInfoHelper.GetTypesInfo();
                                    var xpoTypeInfoSource = XpoTypesInfoHelper.GetXpoTypeInfoSource();
                                    typesInfo.GenerateEntities();

                                    var connectionString = "TheConnectionString";
                                    var dataStoreProvider = new ConnectionStringDataStoreProvider(connectionString);
                                    var objectSpaceProvider = new XPObjectSpaceProvider(dataStoreProvider, typesInfo, xpoTypeInfoSource);
                                    var dict = objectSpaceProvider.XPDictionary;
                                    var store = XpoDefault.GetConnectionProvider(connectionString, DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists);

                                    var dataLayer = new ThreadSafeDataLayer(dict, store);
                                    XpoDefault.DataLayer = dataLayer;
                                    return dataLayer;
                                    }

                                    // This method is called only once to initialize service-wide policies.
                                    public static void InitializeService(DataServiceConfiguration config)
                                    {
                                    config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
                                    config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
                                    config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
                                    config.DataServiceBehavior.AcceptProjectionRequests = true;
                                    }
                                    }

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,
                                You can pass the "DevExpress.ExpressApp.DC.GeneratedClasses" string as the second parameter of the MyContext constructor.

                                [C#]
                                public TheDataService() : base(new MyContext("XpoContext", "DevExpress.ExpressApp.DC.GeneratedClasses", CreateDataLayer())) { }

                                Of course, you should use your own namespace instead of the "DevExpress.ExpressApp.DC.GeneratedClasses" string, which is specific to DC.

                                This can be achieved because the OData service leaves only the difference part when the namespace matches the object's name.
                                Please let me know if this option suits you.

                                • Sidney DC 03.11.2013

                                  Thanks Dennis.
                                  I tried "DevExpress.ExpressApp.DC.GeneratedClasses" and worked.

                                • Dennis (DevExpress) 03.11.2013

                                  Oh, I apologize for giving you not exact string. I have updated my answer accordingly.
                                  Once your question has been resolved to your satisfaction, mark the corresponding answer as a Solution. Your question status will immediately become Closed.
                                  http://devexpress.com/Support/Center/FAQ

                                • Christian Andersen 12.19.2013

                                  Could you please leave a sample on which code exactly should be replaced with which code?
                                  I cannot find anything called DevExpress.ExpressApp.DC.GeneratedClasses in the namespaces and i have would like to know how to use it exactly.

                                • Dennis (DevExpress) 12.20.2013

                                  Here is the updated code:

                                  [C#]
                                  public TheDataService() : base(new MyContext("XpoContext", "DevExpress.ExpressApp.DC.GeneratedClasses", CreateDataLayer())) { }

                                  Of course, you should use your own namespace instead of the "DevExpress.ExpressApp.DC.GeneratedClasses" string (this one is specific to DC).