public PropertyViewModel Build(Property property) { return new PropertyViewModel() { Id = property.Id, HtmlLocalizations = this.GetLocalizations( this.handler.Storage.GetRepository<IDictionaryRepository>().WithKey(property.HtmlId) ) }; }
private void CreateProperty(Object @object, int memberId, string cultureCode, string value) { Property property = this.Storage.GetRepository<IPropertyRepository>().WithObjectIdAndMemberId(@object.Id, memberId); if (property == null) { Dictionary html = new Dictionary(); this.Storage.GetRepository<IDictionaryRepository>().Create(html); this.Storage.Save(); property = new Property(); property.ObjectId = @object.Id; property.MemberId = memberId; property.HtmlId = html.Id; this.Storage.GetRepository<IPropertyRepository>().Create(property); this.Storage.Save(); } Localization localization = new Localization(); localization.DictionaryId = property.HtmlId; localization.CultureId = this.Storage.GetRepository<ICultureRepository>().WithCode(cultureCode).Id; localization.Value = value; this.Storage.GetRepository<ILocalizationRepository>().Create(localization); }
private CachedProperty CacheProperty(Culture culture, Property property) { CachedProperty cachedProperty = new CachedProperty(); cachedProperty.PropertyId = property.Id; cachedProperty.MemberCode = this.handler.Storage.GetRepository<IMemberRepository>().WithKey(property.MemberId).Code; cachedProperty.Html = this.GetLocalizationValue(culture.Id, property.HtmlId); return cachedProperty; }