SmartSql v4.1.3 Release Notes

Release Date: 2019-07-26 // over 4 years ago
    1. Change Sample DB To SQLite And Fix SQLite ParameterPrefix ๐Ÿ‘ 2. add support [For-tag] nest-value-access โšก๏ธ 3. optimize Check null-Tag.Property from XML-tag โšก๏ธ 4. optimize Check null-Tag.Property ExceptionMessage ๐Ÿ‘ 5. add support Cache-Annotations for Repository-interface - Demo

      [Cache("DateCache", "Lru", FlushInterval = 6000)] [Cache("LruCache", "Lru", FlushInterval = 6000)] [Cache("UserCache", "Fifo", FlushOnExecutes = new[] {"UpdateUserName"})] public interface IUsedCacheRepository { [ResultCache("DateCache", Key = "GetNow")] [Statement(Sql = "Select Now();")] DateTime GetNow(); [ResultCache("LruCache", Key = "GetId:$id")] [Statement(Sql = "Select @id;")] int GetId(long id); [ResultCache("UserCache", Key = "GetUserById:$id")] [Statement(Sql = "select * from T_User where id=@id;")] User GetUserById(long id); [Statement(Sql = "update T_User set UserName=@userName where id=@id;")] int UpdateUserName(long id, string userName); }

    ๐Ÿ‘ 1. add support ColumnAttribute for EntityDeserializer ๐Ÿ‘ 2. add support ColumnAttribute for RequestConvert ๐Ÿ‘ 3. add support ParamAttribute for TypeHandler

    1. add ResultType From ArrayType to Object for ExecuteScalar.

      [Annotations.Table("t_annotation_entity")] public class ColumnAnnotationEntity { [Annotations.Column("id", IsAutoIncrement = true)] public long Id { get; set; } [Annotations.Column("name")] public String Name { get; set; } [Annotations.Column("extend_data", TypeHandler = "Json")] public ExtendData Data { get; set; } public class ExtendData { public String Info { get; set; } } }


    public interface IColumnAnnotationRepository { ISqlMapper SqlMapper { get; } [Statement(Sql = "Select Top 1 T.\* From t\_column\_annotation\_entity T where T.id=@id")] ColumnAnnotationEntity GetEntity(long id); [Statement(Sql ="INSERT INTO t\_column\_annotation\_entity(name,extend\_data)VALUES(@Name,@Data);Select Scope\_Identity();")] int Insert(ColumnAnnotationEntity entity); [Statement(Sql ="INSERT INTO t\_column\_annotation\_entity(name,extend\_data)VALUES(@Name,@Data);Select Scope\_Identity();")] int Insert([Param("Name")] string name, [Param("Data", TypeHandler = "Json")] ColumnAnnotationEntity.ExtendData data); }