There's some wrong in DOCUMENTATION/update

Developer
Jun 30, 2013 at 9:56 AM
Edited Jun 30, 2013 at 11:22 AM
I using FluentData 3.0 from nuget.

In page https://fluentdata.codeplex.com/documentation#UpdateData

there's some words like this:

Image

the update code wil be throw exceptions.because some code in fluentdata like this:
public int Execute()
        {
            if (Data.Columns.Count == 0
                       || Data.Where.Count == 0)
                throw new FluentDataException("Columns or where filter have not yet been added.");

            Data.Command.ClearSql.Sql(Data.Command.Data.Context.Data.Provider.GetSqlForUpdateBuilder(Data));
        
            return Data.Command.Execute();
        }
if only AutoMap,the Data.Where.Count is always equals zero,and throw new FluentDataException.

so,the correct way to update model is like this:
int rowsAffected = Context.Update<Product>("Product", product)
            .AutoMap(x => x.ProductId)
            .Where(x => x.ProductId,DataTypes.Int32)
            .Execute();
or like this:
int rowsAffected = Context.Update<Product>("Product", product)
            .AutoMap(x => x.ProductId)
            .Where("ProductId",product.ProductId)
            .Execute();
The above code I have been test,and success.

I hope someone can correct the document's description. : -)
Coordinator
Jun 30, 2013 at 11:33 AM
Great, thanks for the feedback. The documentation has been updated now.
Developer
Jun 30, 2013 at 11:51 AM
Edited Jul 1, 2013 at 12:15 PM
so quickly.
Developer
Jul 20, 2013 at 1:27 AM
Fluency template also suffered this issue. I made updates in TableDataGateway.tt to fix the update method where clause. Nice catch roydx!