public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { if (other != null) { return(this.Equals(other as WingedBagNet)); } return(false); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { if (other != null) { return(this.Equals(other as SimpleTrapDredge)); } return(false); }
public bool Equals(IIdentifiableEntity <Guid> other) { if (other == null) { return(false); } return(this.id.Equals(other.Identity)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { if (other != null) { return(this.Equals(other as StandardPlanktonNet)); } return(false); }
//Here would be constructor injection of INotificationService, IAuthorizationService and IPersistenceService void AddSomeModelAndNotify(User user, SomeModel model) { if (authorizationService.IsAuthorized(user)) { IIdentifiableEntity entity = persistenceService.AddSomeEntity(model); persistenceService.SaveChanges(); // Pass reference entity to Notify. notificationService.Notify(user, entity); } else { throw new UnauthorizedException(); } }
public Identifier Create(IIdentifiableEntity entity) { var entityType = entity.GetType(); var prefix = this.prefixes.ContainsKey(entityType) ? this.prefixes[entity.GetType()] : UnknownEntityPrefix; var guid = Guid.NewGuid(); var identifier = ConvertGuid(guid, prefix); #if TESTINGONLY LastCreatedIds.Add(identifier, guid.ToString("D")); #endif return(identifier.ToIdentifier()); }
public Identifier Create(IIdentifiableEntity entity) { var random = Convert.ToBase64String(Guid.NewGuid().ToByteArray()) .Replace("+", string.Empty) .Replace("/", string.Empty) .Replace("=", string.Empty); var entityType = entity.GetType(); if (this.prefixes.ContainsKey(entityType)) { var prefix = this.prefixes[entity.GetType()]; return($"{prefix}{Delimiter}{random}".ToIdentifier()); } return($"{UnknownEntityPrefix}{Delimiter}{random}".ToIdentifier()); }
/// <summary> /// Gets the creation date of this entity. /// Short for <see cref="Snowflake.CreatedAt"/> from <see cref="IIdentifiableEntity.Id"/>. /// </summary> /// <returns> /// The date at which the entity was created. /// </returns> public static DateTimeOffset CreatedAt(this IIdentifiableEntity entity) => entity.Id.CreatedAt;
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as CatchEffort)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as ProjectStatusType)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as Instrument)); }
public bool Equals(IIdentifiableEntity<CompoundIdentity> other) { return this.Equals(other as SiteAliasScheme); }
public bool Equals(IIdentifiableEntity <Guid> other) { return(this.Equals(other as TreeSample)); }
public Identifier Create(IIdentifiableEntity entity) { return(this.id); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as WaterQualityDeployment)); }
public Identifier Create(IIdentifiableEntity entity) { return(null); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as VegSurvey)); }
public bool Equals(IIdentifiableEntity <Guid> other) { return(this.Equals(other as Fish)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as FieldTeam)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as SamplingEvent)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as Sensor)); }
public Identifier Create(IIdentifiableEntity entity) { return(Guid.NewGuid().ToString("D").ToIdentifier()); }
public bool Equals(IIdentifiableEntity <Guid> other) { return(this.Equals(other as CatchMetric)); }
public bool Equals(IIdentifiableEntity <Guid> other) { return(this.Equals(other as NetHaulEvent)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as Organization)); }
public bool Equals(IIdentifiableEntity <CompoundIdentity> other) { return(this.Equals(other as TaxaUnitType)); }