How do I create efficient SQL select statements for any arbitrary model using Dapper in C#? -
i learned using select *
inefficient , should not used in production code, i'm trying figure best way go creating sql select
statements models. in case, there huge product entity in our database separated different tables, isn't, , i'm creating class represent table. have select table has ton of unnecessary columns don't need pull from, how dynamically create select
statement selects columns need class?
would idea create static method converts class's properties comma-separated list mapped class when query using dapper?
maybe like:
public static string getcolumnsasstring(type class);
Comments
Post a Comment