Skip to content

Commit b369485

Browse files
Merge pull request #87 from johelvisguzman/factory
Renamed RepositoryOptions to RepositoryFactoryOptions
2 parents f1d15ac + 231cb49 commit b369485

File tree

11 files changed

+47
-43
lines changed

11 files changed

+47
-43
lines changed

src/DotNetToolkit.Repository.AdoNet/AdoNetRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class AdoNetRepositoryFactory : IRepositoryFactory
99
{
1010
#region Fields
1111

12-
private readonly IRepositoryOptions _options;
12+
private readonly IRepositoryFactoryOptions _options;
1313

1414
#endregion
1515

@@ -26,7 +26,7 @@ public AdoNetRepositoryFactory()
2626
/// Initializes a new instance of the <see cref="AdoNetRepositoryFactory"/> class.
2727
/// </summary>
2828
/// <param name="options">The options.</param>
29-
public AdoNetRepositoryFactory(IRepositoryOptions options)
29+
public AdoNetRepositoryFactory(IRepositoryFactoryOptions options)
3030
{
3131
if (options == null)
3232
throw new ArgumentNullException(nameof(options));
@@ -38,7 +38,7 @@ public AdoNetRepositoryFactory(IRepositoryOptions options)
3838

3939
#region Private Methods
4040

41-
private Tuple<string, string> GetProviderAndConnectionString(IRepositoryOptions options)
41+
private Tuple<string, string> GetProviderAndConnectionString(IRepositoryFactoryOptions options)
4242
{
4343
if (options == null)
4444
throw new ArgumentNullException(nameof(options));
@@ -95,7 +95,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9595
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9696
/// <param name="options">The options.</param>
9797
/// <returns>The new repository.</returns>
98-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
98+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9999
{
100100
var t = GetProviderAndConnectionString(options);
101101
return new AdoNetRepository<TEntity>(t.Item1, t.Item2, options.Logger);
@@ -108,7 +108,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
108108
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
109109
/// <param name="options">The options.</param>
110110
/// <returns>The new repository.</returns>
111-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
111+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
112112
{
113113
var t = GetProviderAndConnectionString(options);
114114
return new AdoNetRepository<TEntity, TKey>(t.Item1, t.Item2, options.Logger);

src/DotNetToolkit.Repository.Csv/CsvRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class CsvRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public CsvRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="CsvRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public CsvRepositoryFactory(IRepositoryOptions options)
30+
public CsvRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public CsvRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private string GetFilePath(IRepositoryOptions options)
42+
private string GetFilePath(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -90,7 +90,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9090
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9191
/// <param name="options">The options.</param>
9292
/// <returns>The new repository.</returns>
93-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
93+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9494
{
9595
return new CsvRepository<TEntity>(GetFilePath(options), options.Logger);
9696
}
@@ -102,7 +102,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
102102
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
103103
/// <param name="options">The options.</param>
104104
/// <returns>The new repository.</returns>
105-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
105+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
106106
{
107107
return new CsvRepository<TEntity, TKey>(GetFilePath(options), options.Logger);
108108
}

src/DotNetToolkit.Repository.EntityFramework/EfRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class EfRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public EfRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="EfRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public EfRepositoryFactory(IRepositoryOptions options)
30+
public EfRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public EfRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private static DbContext GetDbContext(IRepositoryOptions options)
42+
private static DbContext GetDbContext(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -94,7 +94,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9494
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9595
/// <param name="options">The options.</param>
9696
/// <returns>The new repository.</returns>
97-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
97+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9898
{
9999
return new EfRepository<TEntity>(GetDbContext(options), options.Logger);
100100
}
@@ -106,7 +106,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
106106
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
107107
/// <param name="options">The options.</param>
108108
/// <returns>The new repository.</returns>
109-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
109+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
110110
{
111111
return new EfRepository<TEntity, TKey>(GetDbContext(options), options.Logger);
112112
}

src/DotNetToolkit.Repository.EntityFrameworkCore/EfCoreRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class EfCoreRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public EfCoreRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="EfCoreRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public EfCoreRepositoryFactory(IRepositoryOptions options)
30+
public EfCoreRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public EfCoreRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private static DbContext GetDbContext(IRepositoryOptions options)
42+
private static DbContext GetDbContext(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -94,7 +94,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9494
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9595
/// <param name="options">The options.</param>
9696
/// <returns>The new repository.</returns>
97-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
97+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9898
{
9999
return new EfCoreRepository<TEntity>(GetDbContext(options), options.Logger);
100100
}
@@ -106,7 +106,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
106106
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
107107
/// <param name="options">The options.</param>
108108
/// <returns>The new repository.</returns>
109-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
109+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
110110
{
111111
return new EfCoreRepository<TEntity, TKey>(GetDbContext(options), options.Logger);
112112
}

src/DotNetToolkit.Repository.InMemory/InMemoryRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class InMemoryRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public InMemoryRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="InMemoryRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public InMemoryRepositoryFactory(IRepositoryOptions options)
30+
public InMemoryRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public InMemoryRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private string GetDatabaseName(IRepositoryOptions options)
42+
private string GetDatabaseName(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -90,7 +90,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9090
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9191
/// <param name="options">The options.</param>
9292
/// <returns>The new repository.</returns>
93-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
93+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9494
{
9595
return new InMemoryRepository<TEntity>(GetDatabaseName(options), options.Logger);
9696
}
@@ -102,7 +102,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
102102
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
103103
/// <param name="options">The options.</param>
104104
/// <returns>The new repository.</returns>
105-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
105+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
106106
{
107107
return new InMemoryRepository<TEntity, TKey>(GetDatabaseName(options), options.Logger);
108108
}

src/DotNetToolkit.Repository.Json/JsonRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class JsonRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public JsonRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="JsonRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public JsonRepositoryFactory(IRepositoryOptions options)
30+
public JsonRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public JsonRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private string GetFilePath(IRepositoryOptions options)
42+
private string GetFilePath(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -90,7 +90,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9090
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9191
/// <param name="options">The options.</param>
9292
/// <returns>The new repository.</returns>
93-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
93+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9494
{
9595
return new JsonRepository<TEntity>(GetFilePath(options), options.Logger);
9696
}
@@ -102,7 +102,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
102102
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
103103
/// <param name="options">The options.</param>
104104
/// <returns>The new repository.</returns>
105-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
105+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
106106
{
107107
return new JsonRepository<TEntity, TKey>(GetFilePath(options), options.Logger);
108108
}

src/DotNetToolkit.Repository.Xml/XmlRepositoryFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class XmlRepositoryFactory : IRepositoryFactory
1010
{
1111
#region Fields
1212

13-
private readonly IRepositoryOptions _options;
13+
private readonly IRepositoryFactoryOptions _options;
1414

1515
#endregion
1616

@@ -27,7 +27,7 @@ public XmlRepositoryFactory()
2727
/// Initializes a new instance of the <see cref="XmlRepositoryFactory"/> class.
2828
/// </summary>
2929
/// <param name="options">The options.</param>
30-
public XmlRepositoryFactory(IRepositoryOptions options)
30+
public XmlRepositoryFactory(IRepositoryFactoryOptions options)
3131
{
3232
if (options == null)
3333
throw new ArgumentNullException(nameof(options));
@@ -39,7 +39,7 @@ public XmlRepositoryFactory(IRepositoryOptions options)
3939

4040
#region Private Methods
4141

42-
private string GetFilePath(IRepositoryOptions options)
42+
private string GetFilePath(IRepositoryFactoryOptions options)
4343
{
4444
if (options == null)
4545
throw new ArgumentNullException(nameof(options));
@@ -90,7 +90,7 @@ public IRepository<TEntity, TKey> Create<TEntity, TKey>() where TEntity : class
9090
/// <typeparam name="TEntity">The type of the entity.</typeparam>
9191
/// <param name="options">The options.</param>
9292
/// <returns>The new repository.</returns>
93-
public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class
93+
public IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class
9494
{
9595
return new XmlRepository<TEntity>(GetFilePath(options), options.Logger);
9696
}
@@ -102,7 +102,7 @@ public IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TE
102102
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
103103
/// <param name="options">The options.</param>
104104
/// <returns>The new repository.</returns>
105-
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class
105+
public IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class
106106
{
107107
return new XmlRepository<TEntity, TKey>(GetFilePath(options), options.Logger);
108108
}

src/DotNetToolkit.Repository/IRepositoryFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public interface IRepositoryFactory
2626
/// <typeparam name="TEntity">The type of the entity.</typeparam>
2727
/// <param name="options">The options.</param>
2828
/// <returns>The new repository.</returns>
29-
IRepository<TEntity> Create<TEntity>(IRepositoryOptions options) where TEntity : class;
29+
IRepository<TEntity> Create<TEntity>(IRepositoryFactoryOptions options) where TEntity : class;
3030

3131
/// <summary>
3232
/// Creates a new repository for the specified entity and primary key type.
@@ -35,6 +35,6 @@ public interface IRepositoryFactory
3535
/// <typeparam name="TKey">The type of the key primary key value.</typeparam>
3636
/// <param name="options">The options.</param>
3737
/// <returns>The new repository.</returns>
38-
IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryOptions options) where TEntity : class;
38+
IRepository<TEntity, TKey> Create<TEntity, TKey>(IRepositoryFactoryOptions options) where TEntity : class;
3939
}
4040
}

src/DotNetToolkit.Repository/IRepositoryOptions.cs renamed to src/DotNetToolkit.Repository/IRepositoryFactoryOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// <summary>
77
/// Represents a repository option for creating new repositories.
88
/// </summary>
9-
public interface IRepositoryOptions
9+
public interface IRepositoryFactoryOptions
1010
{
1111
/// <summary>
1212
/// Gets or sets the database context arguments.

src/DotNetToolkit.Repository/RepositoryOptions.cs renamed to src/DotNetToolkit.Repository/RepositoryFactoryOptions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
using Logging;
55

66
/// <summary>
7-
/// An implementation of <see cref="IRepositoryOptions" />.
7+
/// An implementation of <see cref="IRepositoryFactoryOptions" />.
88
/// </summary>
9-
public class RepositoryOptions : IRepositoryOptions
9+
public class RepositoryFactoryOptions : IRepositoryFactoryOptions
1010
{
1111
#region Constructors
1212

1313
/// <summary>
14-
/// Initializes a new instance of the <see cref="RepositoryOptions"/> class.
14+
/// Initializes a new instance of the <see cref="RepositoryFactoryOptions"/> class.
1515
/// </summary>
1616
/// <param name="dbContextType">The type of the database context.</param>
1717
/// <param name="dbContextArgs">The database context arguments.</param>
18-
public RepositoryOptions(Type dbContextType, params object[] dbContextArgs)
18+
public RepositoryFactoryOptions(Type dbContextType, params object[] dbContextArgs)
1919
{
2020
DbContextType = dbContextType;
2121
DbContextArgs = dbContextArgs;
2222
}
2323

2424
#endregion
2525

26-
#region Implementation of IRepositoryOptions
26+
#region Implementation of IRepositoryFactoryOptions
2727

2828
/// <summary>
2929
/// Gets or sets the database context arguments.

0 commit comments

Comments
 (0)