예제 #1
0
 public IActionResult GetLanguageEntity([FromRoute] string languageid, [FromRoute] string clientid, bool propertygroup = false)
 {
     try
     {
         if (!string.IsNullOrEmpty(clientid) && BasePluginConfigGenerator.GetBasePlugin(clientid).GetClientId() == clientid.Trim().ToUpper())
         {
             var requestModel = new GetLanguageEntityRequestModel
             {
                 EntityId = languageid,
             };
             var validationResult = requestModel.Validate();
             if (validationResult.Any())
             {
                 return(BadRequest(validationResult));
             }
             if (propertygroup)
             {
                 return(Ok(MongoConnector.GetLanguageEntityByPropertyGroup(requestModel)));
             }
             else
             {
                 return(Ok(MongoConnector.GetLanguageEntity(requestModel)));
             }
         }
         return(Unauthorized());
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #2
0
        public IActionResult GetLanguageEntity([FromRoute] string languageid)
        {
            try
            {
                string userId = AuthHelper.AuthorizeRequest(Request);

                var requestModel = new GetLanguageEntityRequestModel
                {
                    EntityId = languageid
                };
                var validationResult = requestModel.Validate();
                if (validationResult.Any())
                {
                    return(BadRequest(validationResult));
                }

                return(Ok(MongoConnector.GetLanguageEntity(requestModel)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }