public GetContentTypeResponse Get(Guid id) { IContentTypeRepository repo = IoC.Container.Resolve <IContentTypeRepository>(); GetContentTypeResponse response = repo.GetById <GetContentTypeResponse>(id.ToString()); IParameterRepository paramRepo = IoC.Container.Resolve <IParameterRepository>(); response.Parameters = paramRepo.GetByParentId(id, ParameterParentType.ContentType); return(response); }
public IResponseData <GetContentTypeResponse> GetContentType(Guid id) { IResponseData <GetContentTypeResponse> response = new ResponseData <GetContentTypeResponse>(); try { IContentTypeService service = IoC.Container.Resolve <IContentTypeService>(); GetContentTypeResponse item = service.Get(id); response.SetData(item); } catch (ValidationException ex) { response.SetErrors(ex.Errors); response.SetStatus(HttpStatusCode.PreconditionFailed); } return(response); }