コード例 #1
0
 /// <inheritdoc />
 public override async Task <TConfigurationModelType> RetrieveAsync(GameConfigurationKey <TConfigType> key, CancellationToken token = default, bool includeNavigationProperties = false)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     return(await ModelSet.FindAsync(new object[] { key.Id, key.Config }, token));
 }
コード例 #2
0
        /// <inheritdoc />
        public override Task <PathWaypointModel> RetrieveAsync(PathWaypointKey key, bool includeNavigationProperties = false)
        {
            if (includeNavigationProperties)
            {
                throw new NotImplementedException($"TODO: Add support for nav properties for {nameof(PathWaypointModel)}");
            }

            return(ModelSet.FindAsync(key.PathId, key.PointId));
        }
コード例 #3
0
 public override async Task <DBRPGGroup> RetrieveAsync(int key, CancellationToken token = default, bool includeNavigationProperties = false)
 {
     if (includeNavigationProperties)
     {
         return(await ModelSet
                .Include(g => g.Members)
                .FirstAsync(g => g.Id == key, token));
     }
     else
     {
         return(await ModelSet.FindAsync(new object[] { key }, token));
     }
 }
コード例 #4
0
        /// <inheritdoc />
        public virtual async Task <TModelType> RetrieveAsync(TKey key, bool includeNavigationProperties = false)
        {
            if (includeNavigationProperties)
            {
                TModelType model = await RetrieveAsync(key, false);

                foreach (var navigation in Context.Entry(model).Navigations)
                {
                    navigation.Load();
                }

                return(model);
            }
            else
            {
                return(await ModelSet.FindAsync(key));
            }
        }
        /// <inheritdoc />
        public virtual async Task <TModelType> RetrieveAsync(TKey key, CancellationToken token = default, bool includeNavigationProperties = false)
        {
            if (includeNavigationProperties)
            {
                TModelType model = await RetrieveAsync(key, token, false);

                foreach (var navigation in Context.Entry(model).Navigations)
                {
                    navigation.Load();
                }

                return(model);
            }
            else
            {
                return(await ModelSet.FindAsync(new object[1] {
                    key
                }, token));
            }
        }
コード例 #6
0
 /// <inheritdoc />
 public override Task <PathWaypointModel> RetrieveAsync(PathWaypointKey key)
 {
     return(ModelSet.FindAsync(key.PathId, key.PointId));
 }