public static void getPropertiesName(IEntyty foo) { var fieldValues = foo.GetType() .GetProperties() .Select(field => field.GetValue(foo)) .ToString(); }
protected void GetPropertiesToInsert(ref string sql, IEntyty item) { PropertyInfo[] properrties = item.GetType().GetProperties(); for (int i = 1; i < properrties.Length; ++i) { sql += $" @{properrties[i].Name},"; } sql = sql.Remove(sql.Length - 1); }
protected void GetPropertiesToUpdate(ref string sql, IEntyty item) { sql += $" @{ item.GetType().GetProperties()[0].Name},"; GetPropertiesToInsert(ref sql, item); }