public async Task <APIDBChangesResponseModels.GetDBChangesList> GetDBChangesListAsync(string searchFor, long startFrom, int page, int itemsPerPage)
        {
            List <APIDBChange> apiDBChanges = new List <APIDBChange>();

            APIDBChangesRequestModels.GetDBChangesList requestModel = new APIDBChangesRequestModels.GetDBChangesList();
            requestModel.SearchFor      = searchFor;
            requestModel.StartFrom      = startFrom;
            requestModel.PageNumber     = page;
            requestModel.RecordsPerPage = itemsPerPage;
            APIDBChangesResponseModels.GetDBChangesList responseModel = await client.DBChanges.GetDBChangesListAsync(requestModel);

            return(responseModel);
        }
        public async Task <ResultInfo.Result> InstallDBChanges()
        {
            ResultInfo.Result result = Result.GenerateFailedResult();

            long lastCentralChangeID = 0;
            int  localDBChangesCount = db.DBChanges.Count();

            if (db.DBChanges.Count() > 0)
            {
                lastCentralChangeID = db.DBChanges.ToList()[localDBChangesCount - 1].CentralChangeID;
            }

            APIDBChangesRequestModels.GetDBChangesList requestModel = new APIDBChangesRequestModels.GetDBChangesList();
            requestModel.SearchFor      = "";
            requestModel.StartFrom      = lastCentralChangeID + 1;
            requestModel.PageNumber     = 1;
            requestModel.RecordsPerPage = 10;
            APIDBChangesResponseModels.GetDBChangesList responseModel = await client.DBChanges.GetDBChangesListAsync(requestModel);

            if (responseModel.DBChanges.Count > 0)
            {
                foreach (APIDBChange item in responseModel.DBChanges)
                {
                    db.Database.ExecuteSqlCommand(item.Script);
                    DBChanx dbChange = new DBChanx();
                    dbChange.CentralChangeID = item.ID;
                    dbChange.ChangeCode      = item.Code;
                    dbChange.TimeStamp       = DateTime.Now;
                    db.DBChanges.Add(dbChange);
                    db.SaveChanges();
                }
            }
            result = Result.GenerateOKResult();

            return(result);
        }