I have implemented the CRUD, but I still have a few issues. The issues are described in the second message.
First, about the attached files.
Idea is to create a layer depends only on Dictionaries, modify/comment/use them. That realization isn't included the Batch operations, but will be included in the next version.
The basic idea is to create an abstraction level, for that operation you have to put a list of the following class
public class CRUDInfo
{
/// <summary>
/// Table name
/// </summary>
public string TableName;
/// <summary>
/// ID name
/// </summary>
public string IdName;
public KeyValuePair<string, object> IdPair
{
get
{
return new KeyValuePair<string, object>(IdName, ObjectDictionary[IdName]);
}
}
/// <summary>
/// Dictionary contains dictionary with datatable name of columns and values
/// </summary>
public IDictionary<string, object> ObjectDictionary;
}
abstract internal void Create(IEnumerable<CRUDInfo> data);
abstract internal IEnumerable<CRUDInfo> Retrieve(IEnumerable<CRUDInfo> rInfo);
abstract internal void Update(IEnumerable<CRUDInfo> data);
abstract internal void Delete(IEnumerable<CRUDInfo> data);
crudInfoList.Add( new CRUDInfo()
{
TableName = "People",
IdName = "PeopleId",
ObjectDictionary = new Dictionary<string, object>()
{
{ "PeopleId", "123"},
{ "Name", "John"},
}
};);
crudInfoList.Add( new CRUDInfo()
{
TableName = "Pets",
IdName = "Id",
ObjectDictionary = new Dictionary<string, object>()
{
{ "Id", "1"},
{ "Name", "John' pet"},
{ "PeopleFK", "123"},
}
};);
///This command should create the two records
Create(crudInfoList);