Exemple #1
0
        /// <summary>
        /// Path to the JSON file that contains the initial data for the REST API.
        /// </summary>
        public static IModelConfigurationBuilder <IInMemoryModelConfiguration> HasJsonFilePath(
            this IModelConfigurationBuilder <IInMemoryModelConfiguration> @this,
            string jsonFilePath)
        {
            ExceptionHelper.ArgumentNull.ThrowIfNecessary(jsonFilePath, nameof(jsonFilePath));

            @this.ModelConfiguration.JsonFilePath = jsonFilePath;

            return(@this);
        }
Exemple #2
0
        public static IModelConfigurationBuilder <ICustomModelConfiguration> HasCustomModelConfigurationValue(
            this IModelConfigurationBuilder <ICustomModelConfiguration> @this,
            string customModelConfigurationValue)
        {
            ExceptionHelper.ArgumentNull.ThrowIfNecessary(customModelConfigurationValue, nameof(customModelConfigurationValue));

            @this.ModelConfiguration.CustomModelConfigurationValue = customModelConfigurationValue;

            return(@this);
        }
Exemple #3
0
        public static IModelConfigurationBuilder <ISqlModelConfiguration> HasTableName(
            this IModelConfigurationBuilder <ISqlModelConfiguration> @this,
            string tableName)
        {
            ExceptionHelper.ArgumentNull.ThrowIfNecessary(tableName, nameof(tableName));
            ExceptionHelper.Argument.ThrowIfTrue(!_tableNameRegex.IsMatch(tableName), $"'{tableName}' is an invalid table name.", nameof(tableName));

            @this.ModelConfiguration.TableName = tableName;

            return(@this);
        }
Exemple #4
0
 public void ApplySetup(IModelConfigurationBuilder provider)
 {
     provider.Entity <Project>(
         p => p.Filter(x => x.Id, Constants.ProjectParameter)
         );
 }