public async Task <IActionResult> AddConetntType(string name, bool isMainPage) { if (!String.IsNullOrEmpty(name)) { await _contentTypeService.Create(new ContentType { Name = name, IsMainPage = isMainPage, IsActive = false }); } short id = 0; return(ViewComponent("ContentType", new { selectedContentType = id })); }
public IResponseData <bool> CreateContentType(CreateContentTypeRequest request) { IResponseData <bool> response = new ResponseData <bool>(); try { IContentTypeService service = IoC.Container.Resolve <IContentTypeService>(); service.Create(request); response.SetData(true); } catch (ValidationException ex) { response.SetErrors(ex.Errors); response.SetStatus(HttpStatusCode.PreconditionFailed); } return(response); }
public void CreateContentType(CreateContentTypeRequest request) { IContentTypeService service = IoC.Container.Resolve <IContentTypeService>(); service.Create(request); }