// Copyright © 2017 Dmitry Sikorsky. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using ExtCore.Data.Abstractions;
using ExtCore.Data.Entities.Abstractions;
namespace ExtCore.Data.Dapper;
///
/// Implements the IRepository interface and represents default repository behavior.
///
/// The entity type this repository operates.
public abstract class RepositoryBase : IRepository where TEntity : class, IEntity
{
protected IStorageContext storageContext;
protected string connectionString;
///
/// Sets the Dapper storage context that represents the physical storage to work with.
///
/// The Dapper storage context to set.
public void SetStorageContext(IStorageContext storageContext)
{
this.storageContext = storageContext;
this.connectionString = (storageContext as StorageContextBase).ConnectionString;
}
}