public IHttpActionResult Get(int id) { ThrowIfUserHasNoRole(readRole); using (TechnologyQuery technologyQuery = new TechnologyQuery(Db)) { var data = technologyQuery.GetByPrimaryKey(id); SaveLog("Technology", "Get", JsonConvert.SerializeObject(new { primaryKey = id })); return(Ok(new SuccessResponse(data))); } }
private TechnologyEntryModel GetUpdateStateModel(int technologyPK) { TechnologyEntryFormData formData = new TechnologyEntryFormData(); List <Control> formControls = CreateFormControls(technologyPK); TechnologyDTO technologyDTO = technologyQuery.GetByPrimaryKey(technologyPK); if (technologyDTO == null) { throw new KairosException($"Record with primary key '{technologyDTO.Technology_PK}' is not found."); } return(new TechnologyEntryModel() { FormData = formData, FormControls = formControls, Model = technologyDTO, }); }