public Task CreateAsync(SearchCategoryOption categoryOption)
        {
            if (categoryOption == null)
            throw new ArgumentNullException("categoryOption");

              return Task.Factory.StartNew(() =>
              {
            categoryOption.Id = Guid.NewGuid();
            using (IDbConnection connection = CurrentContext.OpenConnection())
              connection.Execute("insert into app_SearchCategoryOptions(Id, CategoryId, Name) values(@Id, @CategoryId, @Name)", categoryOption);
              });
        }
 public Task SaveAsync(SearchCategoryOption categoryOption)
 {
     if (categoryOption.Id == Guid.Empty)
       {
     return CreateAsync(categoryOption);
       }
       else
       {
     return UpdateAsync(categoryOption);
       }
 }
        public Task UpdateAsync(SearchCategoryOption categoryOption)
        {
            if (categoryOption == null)
            throw new ArgumentNullException("categoryOption");

              return Task.Factory.StartNew(() =>
              {
            using (IDbConnection connection = CurrentContext.OpenConnection())
              connection.Execute("update app_SearchCategoryOptions SET CategoryId=@CategoryId, Name=@Name where Id = @Id", categoryOption);
              });
        }