public bool Equals(Number640 other) { var t1 = LocationKey.Equals(other.LocationKey); var t2 = DomainKey.Equals(other.DomainKey); var t3 = ContentKey.Equals(other.ContentKey); var t4 = VersionKey.Equals(other.VersionKey); return(t1 && t2 && t3 && t4); }
private string RenderStaticContent(ModuleFile file) { var localizationContext = this.GetService <ILocalizationContext>(); Language defaultLanguage = localizationContext.Languages.FirstOrDefault(x => x.IsDefault); ContentKey staticContentKeyWithContent = localizationContext .ContentKeys .Where(x => x.Id == int.Parse(file.ReferenceId)) .Include(x => x.StaticContentList) .FirstOrDefault(); return(file.RenderTemplate(new Dictionary <string, object> { { "Key", staticContentKeyWithContent }, { "DefaultLanguage", defaultLanguage }, })); }
public int CompareTo(Number640 other) { int diff = LocationKey.CompareTo(other.LocationKey); if (diff != 0) { return(diff); } diff = DomainKey.CompareTo(other.DomainKey); if (diff != 0) { return(diff); } diff = ContentKey.CompareTo(other.ContentKey); if (diff != 0) { return(diff); } return(VersionKey.CompareTo(other.VersionKey)); }
public void RoundTrip_WithoutSpecifyingOptionalData_LoadsExpectedKey() { var contentKey = new ContentKey { Id = Guid.NewGuid(), Value = new byte[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }; var document = new CpixDocument(); document.ContentKeys.Add(contentKey); document = TestHelpers.Reload(document); var loadedKey = document.ContentKeys.Single(); Assert.Single(document.ContentKeys); Assert.Equal(contentKey.Id, loadedKey.Id); Assert.Equal(contentKey.Value, loadedKey.Value); Assert.Null(loadedKey.ExplicitIv); }
/// <inheritdoc/> public async Task <MutationResult> Handle(CreateContentKeyWithContentCommand request, CancellationToken cancellationToken) { var key = new ContentKey { Key = request.Key, }; foreach (var value in request.StaticContentList) { key.StaticContentList.Add(new StaticContent { LanguageId = value.LanguageId, Content = value.Content, }); } this.context.ContentKeys.Add(key); await this.context.SaveChangesAsync(cancellationToken); return(new MutationResult(key.Id.ToString())); }
public override int GetHashCode() { return(LocationKey.GetHashCode() ^ DomainKey.GetHashCode() ^ ContentKey.GetHashCode() ^ VersionKey.GetHashCode()); }
public ContentVM GetVMByKey(ContentKey key) => Builder.BuildContentVM(GetByKey(key));
/// <summary> /// returns the content by it's content key if exists. otherwise creates one /// </summary> /// <param name="key"></param> /// <returns></returns> public Content GetByKey(ContentKey key) => GetQuery().Where(m => m.Key == (byte)key).FirstOrDefault() ?? new Content(key);
public static string ToFormattedString(this ContentKey key, string format) { //do staff }
public Content(ContentKey key) { Key = (byte)key; }