jeudi 10 août 2017

Design Pattern issue for a .net application [on hold]

what should be a simple however a scalable design pattern for the below development in Asp.Net (C#). I need to develop an excutable which would be doing below :

Requirement:

Read Application (Say App A) db to know what all information required from other application (say App B) by hitting a WCF service

Hit the Application B Web service to get the required details in a loop

Write All Data to Application A

this includes:

A DataModel File for required data Connection details to connect to App B DB Connection details to connect to App A logger

Sample for DB connection

public class DateModel
{
    public string Id { get; set; }
    public string Name{ get; set; }
}

    private static string dbConn
    {
        get
        {
            return string.Format("DbConn");                       

        }
    }

    private static void Readdata()
    {


        string sqlCmd = "SELECT * from Emp";

        using (OracleConnection dbconn= new OracleConnection(connstr))
        {
            dbconn.Open();
            using (OracleCommand cmd = new OracleCommand(sqlCmd, dbconn))
            {
                using (OracleDataReader rdr = cmd.ExecuteReader())
                {
                    while (rdr.Read())
                    {
                        string record = string.Empty;
                         // Prepare the data

                }
            }
        }
    }

Aucun commentaire:

Enregistrer un commentaire