Ticket T408754
Visible to All Users

Questions on FileStream (Q182572)

created 9 years ago

[DevExpress Support Team: CLONED FROM Q182572: FILESTREAM and FileData]
Hi,

This solution was 8 years ago.  I tried to converted it to use with XAF 15.2.xx it did not work.  Please convert this example to work with XAF 15.2.xx and please provide VB example.

Thank you.

Answers approved by DevExpress Support

created 9 years ago

Hello,

I am afraid we do not have a ready VB.NET example for the latest version. It is also a bad idea or a difficult task to convert a 8 year old XAF project to the latest version, because of many changes in the API and project structure.
I suggest you consider the following plan instead:

  1. Create a new XAF v15.X solution from scratch.
  2. Copy only significant or important files from the FileStreamSupport.Module project: BaseObject.cs, FileData.cs, and TestDomainObject.cs.
  3. Use free online C# to VB.NET converters (e.g., this one) or other specialized tools to convert the source in these files.
    Let me know once you have had an opportunity to implement and test this functionality.

    Other Answers

    created 9 years ago (modified 9 years ago)

    Hi Dennis,
    since the Oliver suggestion was 8 years old , and now the BaseObject has the Oid property of GUID type, I'm asking if instead of rewrite the BaseObject and FileData class if it possible to add the attribute using the CustomizeTypesInfo() method of the Module.cs writing something like:

    C#
    public override void CustomizeTypesInfo(DevExpress.ExpressApp.DC.ITypesInfo typesInfo) { base.CustomizeTypesInfo(typesInfo); XPDictionary xpDictionary = DevExpress.ExpressApp.Xpo.XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary; xpDictionary.GetClassInfo(typeof(FileData)).FindMember("Content").AddAttribute(new DbTypeAttribute("VARBINARY(MAX) FILESTREAM")); xpDictionary.GetClassInfo(typeof(BaseObject)).FindMember("Oid").AddAttribute(new DbTypeAttribute("uniqueidentifier UNIQUE")); XafTypesInfo.Instance.RefreshInfo(typeof(FileData)); XafTypesInfo.Instance.RefreshInfo(typeof(BaseObject)); }

    What do you think about that?
    Many thanks.
    Emanuele

      Comments (1)
      Dennis Garavsky (DevExpress) 9 years ago

        This approach looks fine and should work for a newly created database schema (existing databases will NOT be affected by these changes). In general, indirect customizations like this may be more difficult to maintain in the future. Not to forget what this is for and also to be able to reuse this code in other projects easier, I recommend you put this customization into a separate XAF module.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.