0

I have a C# WCF project that have around 35 services. Each service returns and receives a DataSet.

Example:

public DataSet GetEmployeeInfo(string uid)
        {
            DataSet ds = null;

            SqlParameter paramUID = new SqlParameter("@uid", SqlDbType.UniqueIdentifier);
            paramUID.Value = new Guid(uid);

            ... some code here

            return ds;

          }


public bool UpdateEmployeeInfo(DataSet ds, int userid)
        {
            bool returnVal = true;
            Guid facilityUID = Guid.Empty;

            SqlConnection conn = new SqlConnection(Common.GetConnectionString());
            conn.Open();
            SqlTransaction trans = conn.BeginTransaction(IsolationLevel.ReadUncommitted, "UpdateEmployeeInfo");

            try
            {
            ... some code
            }
}

I would like to know if there is a way to keep the same DataSet object and migrate to gRPC service.

I don't see me changing all my WCF service to change DataSet to a POCO class because that would be a huge change and would take more than 6 months of work.

Any way to do this or a workaround?

halfer
  • 19,824
  • 17
  • 99
  • 186
VAAA
  • 14,531
  • 28
  • 130
  • 253
  • Although returning dataset is not a good practice see https://stackoverflow.com/questions/25874224/why-returning-dataset-or-data-table-from-wcf-service-is-not-a-good-practice-wha you can take a look at this https://github.com/dotarj/protobuf-net-data – Selim Yildiz Sep 06 '20 at 21:18
  • Yes I know that anyway this applications has been working like this for more than 8 years with more than 5,000 concurrent users so nothing to do here. Would love to have time to change everything to POCO classes but for now I dont have time. Ok this protobuf seems to be the solution, Appreciate it @SelimYıldız, hope I can find a sample on how to use with DataSets. – VAAA Sep 06 '20 at 23:48
  • gRPC services send and receive data as Protocol Buffer (Protobuf) messages, similar to data contracts in Windows Communication Foundation (WCF). About migrating WCF solutions to gRPC you can refer to this link:https://learn.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/migrate-wcf-to-grpc – Ding Peng Sep 11 '20 at 06:29

0 Answers0