public T ConvertFromModel <T>(T fromObj) where T : IModel { FromModelToDictionaryBuilder builder = new FromModelToDictionaryBuilder(); Dictionary dic = builder.ConvertFromModel(fromObj) as Dictionary; return((T)(object)JsonParse(JsonConvert.SerializeObject(dic))); }
public T ConvertFromModel <T>(IEnumerable <T> fromObj) where T : IModel { FromModelToDictionaryBuilder builder = new FromModelToDictionaryBuilder(); IEnumerable <Dictionary> dictionary = (IEnumerable <Dictionary>)builder.ConvertFromModel(fromObj); return((T)(object)JsonParse(JsonConvert.SerializeObject(dictionary))); }