@@ -134,5 +134,40 @@ public void InsertWithByteArray()
134134 Assert . Equal ( "INSERT INTO [Books] ([Id], [CoverImageBytes]) VALUES (?, ?)" , exemplar . RawSql ) ;
135135 Assert . Equal ( "INSERT INTO [Books] ([Id], [CoverImageBytes]) VALUES (@p0, @p1)" , exemplar . Sql ) ;
136136 }
137+
138+
139+ private class Account
140+ {
141+ public Account ( string name , string currency = null , string created_at = null , string color = null )
142+ {
143+ this . name = name ?? throw new ArgumentNullException ( "name must be provided" ) ;
144+ this . Currency = currency ;
145+ this . color = color ;
146+ }
147+
148+ public string name { get ; set ; }
149+ [ Column ( "currency_id" ) ]
150+ public string Currency { get ; set ; }
151+ [ Ignore ]
152+ public string color { get ; set ; }
153+ }
154+
155+ [ Fact ]
156+ public void InsertWithIgnoreAndColumnProperties ( )
157+ {
158+ var account = new Account ( name : $ "popular", color : $ "blue", currency : "US" ) ;
159+ var query = new Query ( "Account" ) . AsInsert ( account ) ;
160+
161+ var c = Compile ( query ) ;
162+
163+ Assert . Equal (
164+ "INSERT INTO [Account] ([name], [currency_id]) VALUES ('popular', 'US')" ,
165+ c [ EngineCodes . SqlServer ] ) ;
166+
167+ Assert . Equal (
168+ "INSERT INTO \" ACCOUNT\" (\" NAME\" , \" CURRENCY_ID\" ) VALUES ('popular', 'US')" ,
169+ c [ EngineCodes . Firebird ] ) ;
170+ }
171+
137172 }
138173}
0 commit comments