Sendgrid-csharp: Regarding SendGrid 9.0-beta. Any documentation for breaking changes? [.NET C#]

Created on 9 Feb 2017  路  7Comments  路  Source: sendgrid/sendgrid-csharp

Issue Summary

I'm getting breaking changes when upgrading sendgrid-csharp from 8.0.5 to 9.0.2-beta. Is there any documentation on these breaking changes?

Steps to Reproduce

  1. Upgrade sendgrid-csharp from 8.0.5 to 9.0.2-beta
  2. Try to use SendGridAPIClient as described in Hello Email example

Expected result: Working email test client
Actual result:

Test.cs(20,30): error CS0246: The type or namespace name 'SendGridAPIClient' could not be found (are you missing a using directive or an assembly reference?) [C:\dev\foo\foo.csproj]
Test.cs(22,28): error CS0246: The type or namespace name 'Email' could not be found (are you missing a using directive or an assembly reference?) [C:\dev\foo\foo.csproj]
Test.cs(24,26): error CS0246: The type or namespace name 'Email' could not be found (are you missing a using directive or an assembly reference?) [C:\dev\foo\foo.csproj]
Test.cs(27,28): error CS0246: The type or namespace name 'Mail' could not be found (are you missing a using directive or an assembly reference?) [C:\dev\foo\foo.csproj]

Technical details:

  • sendgrid-csharp Version: 9.0.2-beta
  • .NET Version: 4.6.2
question

All 7 comments

Hello @mikeesouth,

The v9 version of the SDK is a major breaking change from v8. The library was re-architected and the current documentation can be found here: https://github.com/sendgrid/sendgrid-csharp/tree/v9beta.

We have not yet written the documentation regarding upgrading. We will likely add that documentation to the README upon release, which should happen with a few weeks as we continue to gather feedback from the beta.

Please let me know if you run into any issues. Thanks!

Hello @mikeesouth,

Have you been able to get v9 working for you?

Hi @thinkingserious,

Thanks for your replies and the current documentation. I haven't got to testing this yet but I'm intending to test it within a couple of weeks, hopefully sooner than later. I'll post my experience here so that we can close the question.

Hi @thinkingserious,

Is SendGrid v9 still in beta? On nuget.org it says 9.0.12 is the latest (not prerelease), but the docs and source aren't updated in master. I'm a little confused if I should've upgraded to 9.0 or not yet... I have a lot of build breaks and no explanation of how to resolve them. (i.e. Where did the Mail class go? How do I send mail when client.mail.send.post(requestBody: mail.Get()) has been removed?). If v9 is still in beta, then I'll rollback to v8.

Hello @jt000,

Thanks for reaching out and my apologies for the confusion.

Verson 9 is out of beta and is a complete rewrite. The current code is on master, and you can find an explanation for the 12 point releases at the releases tab or in the Changelog.

I suggest you start with the examples in the README, then move to either the .NET Core or .NET 4.5.2 example projects. The kitchen sink test may also prove useful for more advanced cases.

We have also updated the usage docs for non mail/send calls along with corresponding examples.

We have a transactional template example here and would love some feedback on what other use cases you would like to see there. We are already planning to add one for attachments.

Could you please point me to any places that are not updated? I believe we have updated all source and documentation.

I hope that helps and please feel free to reach back out with feedback and/or requests for assistance.

Thanks for supporting SendGrid!

With Best Regards,

Elmer

I might be a little confused... The sample on master still refers to SendGridClient, which doesn't exist anymore in v9, right?

using System;
using System.Threading.Tasks;
using SendGrid;

namespace Example
{
    internal class Example
    {
        private static void Main()
        {
            Execute().Wait();
        }

        static async Task Execute()
        {
            var apiKey = Environment.GetEnvironmentVariable("NAME_OF_THE_ENVIRONMENT_VARIABLE_FOR_YOUR_SENDGRID_KEY");
            var client = new SendGridClient(apiKey);
            var queryParams = @"{
                'limit': 100
            }";
            var response = await client.RequestAsync(method: SendGridClient.Method.GET,
                                                     urlPath: "suppression/bounces",
                                                     queryParams: queryParams);
        }
    }
}

Ah, I'm sorry... I think I see where I'm confused. SendGridAPIClient appears to have been renamed to SendGridClient (I didn't notice the API difference). Let me give this another try & get back to you if I have any additional issues. Thanks!

Was this page helpful?
0 / 5 - 0 ratings