コード例 #1
0
ファイル: WingedBagNet.cs プロジェクト: OSRS/Oncor_OsrsLegacy
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     if (other != null)
     {
         return(this.Equals(other as WingedBagNet));
     }
     return(false);
 }
コード例 #2
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     if (other != null)
     {
         return(this.Equals(other as SimpleTrapDredge));
     }
     return(false);
 }
コード例 #3
0
 public bool Equals(IIdentifiableEntity <Guid> other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.id.Equals(other.Identity));
 }
コード例 #4
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     if (other != null)
     {
         return(this.Equals(other as StandardPlanktonNet));
     }
     return(false);
 }
コード例 #5
0
    //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();
        }
    }
コード例 #6
0
        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());
        }
コード例 #7
0
        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());
        }
コード例 #8
0
 /// <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;
コード例 #9
0
ファイル: CatchEffort.cs プロジェクト: OSRS/Oncor_Base
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as CatchEffort));
 }
コード例 #10
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as ProjectStatusType));
 }
コード例 #11
0
ファイル: Instrument.cs プロジェクト: OSRS/Oncor_OsrsLegacy
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as Instrument));
 }
コード例 #12
0
 public bool Equals(IIdentifiableEntity<CompoundIdentity> other)
 {
     return this.Equals(other as SiteAliasScheme);
 }
コード例 #13
0
ファイル: TreeSample.cs プロジェクト: OSRS/Oncor_Base
 public bool Equals(IIdentifiableEntity <Guid> other)
 {
     return(this.Equals(other as TreeSample));
 }
コード例 #14
0
 public Identifier Create(IIdentifiableEntity entity)
 {
     return(this.id);
 }
コード例 #15
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as WaterQualityDeployment));
 }
コード例 #16
0
ファイル: TestEntity.cs プロジェクト: jezzsantos/queryany
 public Identifier Create(IIdentifiableEntity entity)
 {
     return(null);
 }
コード例 #17
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as VegSurvey));
 }
コード例 #18
0
 public bool Equals(IIdentifiableEntity <Guid> other)
 {
     return(this.Equals(other as Fish));
 }
コード例 #19
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as FieldTeam));
 }
コード例 #20
0
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as SamplingEvent));
 }
コード例 #21
0
ファイル: Sensor.cs プロジェクト: OSRS/Oncor_OsrsLegacy
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as Sensor));
 }
コード例 #22
0
 public Identifier Create(IIdentifiableEntity entity)
 {
     return(Guid.NewGuid().ToString("D").ToIdentifier());
 }
コード例 #23
0
 public bool Equals(IIdentifiableEntity <Guid> other)
 {
     return(this.Equals(other as CatchMetric));
 }
コード例 #24
0
ファイル: NetHaulEvent.cs プロジェクト: OSRS/Oncor_Base
 public bool Equals(IIdentifiableEntity <Guid> other)
 {
     return(this.Equals(other as NetHaulEvent));
 }
コード例 #25
0
ファイル: Organization.cs プロジェクト: OSRS/Oncor_OsrsLegacy
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as Organization));
 }
コード例 #26
0
ファイル: TaxaUnitType.cs プロジェクト: OSRS/Oncor_OsrsLegacy
 public bool Equals(IIdentifiableEntity <CompoundIdentity> other)
 {
     return(this.Equals(other as TaxaUnitType));
 }