Lead Product Evangelist @Kentico, Founding partner @craftbrewingbiz. love to learn / teach web dev & software engineering, collecting vinyl records, mowing my lawn, craft 🍺
I handle page attachments and media library files the same way I handle Page Type data.
I create POCO class that represents the minimum about of information the presentation layer needs about that object and project the *Info type into it within my data access layer.
I typically have a ImageContent type and a MediaContent type. These have the Guid and ID fields of the database objects they represent and other important values like URLs and Labels. Images have width/height properties.
But the key part is that I'm returning a limited set of values and only working with the Kentico types in the data access implementation methods.
This makes my caching slimmer and allows me to adjust my data access implementation more easily (returning an AttachmentInfo makes it hard to return additional metadata from an external system, for example).
Specially to your question, the IPageAttachmentUrl are resolved and turned into a string URL property on my MediaContent type in the data access implementation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I handle page attachments and media library files the same way I handle Page Type data.
I create POCO class that represents the minimum about of information the presentation layer needs about that object and project the
*Info
type into it within my data access layer.I typically have a
ImageContent
type and aMediaContent
type. These have theGuid
and ID fields of the database objects they represent and other important values like URLs and Labels. Images have width/height properties.But the key part is that I'm returning a limited set of values and only working with the Kentico types in the data access implementation methods.
This makes my caching slimmer and allows me to adjust my data access implementation more easily (returning an
AttachmentInfo
makes it hard to return additional metadata from an external system, for example).Specially to your question, the
IPageAttachmentUrl
are resolved and turned into a stringURL
property on myMediaContent
type in the data access implementation.