Ejemplo n.º 1
0
        public ScriptReview GetScriptReview(int scriptId)
        {
            Script objScript = _context.Scripts.Where(x => x.ScriptId == scriptId).FirstOrDefault();
            List <ScriptContent> objListScriptContent = _context.ScriptContents.Where(x => x.ScriptId == scriptId).ToList();

            objScript.ScriptContents = objListScriptContent;
            List <Feedback> objListFeedBacks = _context.Feedbacks.Where(x => x.Type == 0 && x.TypeId == scriptId).ToList();
            ScriptReview    objScriptReview  = new ScriptReview
            {
                Feedbacks  = objListFeedBacks,
                Script     = objScript,
                AddedOn    = objScript.CreatedOn,
                ApprovedOn = objScript.ApprovedOn
            };

            return(objScriptReview);
        }
Ejemplo n.º 2
0
 public ResponseModel <ScriptReview> GetScriptReview(GetById objGetById)
 {
     try
     {
         ScriptProvider objScriptProvider = new ScriptProvider(_context);
         ScriptReview   objScriptReview   = objScriptProvider.GetScriptReview(objGetById.Id);
         ResponseModel <ScriptReview> objResponseModel = new ResponseModel <ScriptReview>
         {
             StatusCode     = 1,
             Message        = "Success",
             ResponseObject = objScriptReview,
         };
         return(objResponseModel);
     }
     catch (Exception ex)
     {
         ResponseModel <ScriptReview> objResponseModel = new ResponseModel <ScriptReview>
         {
             StatusCode = 0,
             Message    = ex.Message,
         };
         return(objResponseModel);
     }
 }