Esempio n. 1
0
        public IHttpActionResult Delete([FromBody] ReportSectionLanguage reportSectionLanguage, [FromUri] string lang = "en")
        {
            using (CSSPDBContext db = new CSSPDBContext(DatabaseType))
            {
                ReportSectionLanguageService reportSectionLanguageService = new ReportSectionLanguageService(new Query()
                {
                    Language = (lang == "fr" ? LanguageEnum.fr : LanguageEnum.en)
                }, db, ContactID);

                if (!reportSectionLanguageService.Delete(reportSectionLanguage))
                {
                    return(BadRequest(String.Join("|||", reportSectionLanguage.ValidationResults)));
                }
                else
                {
                    reportSectionLanguage.ValidationResults = null;
                    return(Ok(reportSectionLanguage));
                }
            }
        }