protected override void Handle(CategoryAdded evt, IDbCommand cmd)
        {
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "INSERT INTO AvailableCategories ([Id],[Title]) values (@id, @title)";
            cmd.AddStringParameter("id", evt.Id);
            cmd.AddStringParameter("title", evt.Title, 255);

            cmd.ExecuteNonQuery();
        }
        protected override void Handle(CategoryAdded evt, IDbCommand cmd)
        {
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "INSERT INTO CatalogTree ([Id],[Title],[ParentId]) values (@id, @title, @parentId)";
            cmd.AddStringParameter("id", evt.Id);
            cmd.AddStringParameter("title", evt.Title, 255);
            cmd.AddStringParameter("parentId", evt.ParentId);

            cmd.ExecuteNonQuery();
        }
예제 #3
0
 public static void AddLongStringParameter(this IDbCommand cmd, string name, string value)
 {
     cmd.AddStringParameter(name, value, 4000);
 }