Last active
July 27, 2022 10:14
-
-
Save ridvansumset/d3f5cc2c29e4a989e5c2db7e8d0253b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//model | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace YNY.Sync | |
{ | |
public class Column | |
{ | |
public Column() | |
{ | |
} | |
public string Name { get; set; } | |
public string Typ { get; set; } | |
public bool Nullable { get; set; } | |
} | |
public class Param | |
{ | |
public string Name { get; set; } | |
public object Value { get; set; } | |
public Param(string Name, object Value) | |
{ | |
this.Name = Name; | |
this.Value = Value; | |
} | |
public Param() | |
{ | |
} | |
} | |
public class Params : IList<Param> | |
{ | |
private readonly IList<Param> _list = new List<Param>(); | |
public Param this[int index] | |
{ | |
get { return _list[index]; } | |
set { _list[index] = value; } | |
} | |
public int Count => _list.Count; | |
public bool IsReadOnly => throw new NotImplementedException(); | |
public void Add(string name, object value) | |
{ | |
Add(new Param() { Name = name, Value = value }); | |
} | |
public void Add(Param item) | |
{ | |
_list.Add(item); | |
} | |
public void Clear() | |
{ | |
throw new NotImplementedException(); | |
} | |
public bool Contains(Param item) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void CopyTo(Param[] array, int arrayIndex) | |
{ | |
throw new NotImplementedException(); | |
} | |
public IEnumerator<Param> GetEnumerator() | |
{ | |
throw new NotImplementedException(); | |
} | |
public int IndexOf(Param item) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void Insert(int index, Param item) | |
{ | |
throw new NotImplementedException(); | |
} | |
public bool Remove(Param item) | |
{ | |
throw new NotImplementedException(); | |
} | |
public void RemoveAt(int index) | |
{ | |
throw new NotImplementedException(); | |
} | |
IEnumerator IEnumerable.GetEnumerator() | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
} | |
//example | |
Params prms = new Params(); | |
prms.Add("created_at", place["created_at"]); | |
prms.Add("updated_at", place["modified_at"]); | |
prms.Add("external_id", place["id"]); | |
prms.Add("external_str", place["uuid"]); | |
prms.Add("slug", place["slug"]); | |
Utils.QueryGenerator(ref cmd, "place_tab", "external_str", "", prms, i); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment