public string Stats() { if (photos.Count < 1) { return("No Photos"); } var hasDate = photos.Where(x => x.Date.HasValue).Count(); var noCertainDate = photos.Count - hasDate; var hasAtLeastYear = photos.Where(x => !x.Date.HasValue && x.UncertainDate.HasValue).Count(); var hasAtLeastMonth = photos.Where(x => !x.Date.HasValue && x.UncertainDate.HasValue && !x.UnknownMonth).Count(); var hasNeitherDate = photos.Where(x => !x.EitherDate.HasValue).Count(); var hasBounds = photos.Where(x => !x.EitherDate.HasValue && x.UpperBoundFromRelationships.HasValue && x.LowerBoundFromRelationships.HasValue).Count(); var msg = $"{(hasDate / photos.Count):##%} ({hasDate} of {photos.Count}) have a date\r\n"; if (noCertainDate > 0) { msg += $"Of those without a date, {(hasAtLeastYear / noCertainDate):##%} ({hasAtLeastYear} of {noCertainDate}) have some estimate\r\n"; } if (hasNeitherDate > 0) { msg += $"Of those without even an estimated date, {(hasBounds / hasNeitherDate):##%} ({hasBounds} of {noCertainDate}) have some inferred bounds\r\n"; } //current photos msg += $"Reference Photo Date: {ReferencePhoto.ExplainDate()}\r\n"; msg += $"Target Photo Date: {TargetPhoto.ExplainDate()}\r\n"; return(msg); }
/// <summary> /// Tests the method. /// </summary> /// <param name="referencePhoto">The reference photo.</param> /// <returns> /// Task Instance /// </returns> public async Task CreateReferencePhotoAsync(ReferencePhoto referencePhoto) { referencePhoto.PhotoTypeId = this.applicationSetting.MediaTypeId; await this.referencePhotoClient.CreateReferencePhotoAsync(referencePhotoRequestBody: JsonConvert.SerializeObject(referencePhoto)); }
public void ConfirmCurrentRelationship(bool targetIsNewer) { ReferencePhoto.AddRelationship(TargetPhoto, targetIsNewer); TargetPhoto.AddRelationship(ReferencePhoto, !targetIsNewer); NewTargetPhoto(); }
/// <summary> /// Creates the reference photo asynchronous. /// </summary> /// <param name="referencePhoto">The reference photo.</param> /// <returns> /// Task instance /// </returns> public async Task CreateReferencePhotoAsync(ReferencePhoto referencePhoto) { await this.guestReferencePhotoServiceClientRepository.CreateReferencePhotoAsync(referencePhoto); }