private static void DoIfExists(ArchivedArtistVersion version, ArtistEditableFields field, XmlCache <ArchivedArtistContract> xmlCache, Action <ArchivedArtistContract> func) { var versionWithField = version.GetLatestVersionWithField(field); if (versionWithField != null && versionWithField.Data != null) { var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data); func(data); } }
private static void DoIfExists(ArchivedArtistVersion version, ArtistEditableFields field, XmlCache<ArchivedArtistContract> xmlCache, Action<ArchivedArtistContract> func) { var versionWithField = version.GetLatestVersionWithField(field); if (versionWithField != null && versionWithField.Data != null) { var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data); func(data); } }
public static EntryForPictureDisplayContract Create(ArchivedArtistVersion archivedVersion, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => archivedVersion); var name = archivedVersion.Artist.TranslatedName[languagePreference]; var versionWithPic = archivedVersion.GetLatestVersionWithField(ArtistEditableFields.Picture); PictureContract pic = null; if (versionWithPic != null && versionWithPic.Picture != null) pic = new PictureContract(versionWithPic.Picture, versionWithPic.PictureMime, Size.Empty); return new EntryForPictureDisplayContract(EntryType.Artist, archivedVersion.Artist.Id, name, archivedVersion.Version, pic); }
public static EntryForPictureDisplayContract Create(ArchivedArtistVersion archivedVersion, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => archivedVersion); var name = archivedVersion.Artist.TranslatedName[languagePreference]; var versionWithPic = archivedVersion.GetLatestVersionWithField(ArtistEditableFields.Picture); PictureContract pic = null; if (versionWithPic != null && versionWithPic.Picture != null) { pic = new PictureContract(versionWithPic.Picture, versionWithPic.PictureMime); } return(new EntryForPictureDisplayContract(EntryType.Artist, archivedVersion.Artist.Id, name, archivedVersion.Version, pic)); }