public IHttpActionResult DeleteCustomField(int id, int customfieldId, CustomFieldModel source)
        {
            IHttpActionResult result = null;

            return result;
        }
        public async Task<IHttpActionResult> UpdaetCustomFieldAsync(int collectionId, int customfieldId, CustomFieldModel source)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IHttpActionResult result = null;

            source.Id = customfieldId;

            var getCollectionResult = await _collectionService.GetCollectionAsync(collectionId);

            if (getCollectionResult.Error != null)
            {
                switch (getCollectionResult.Error.CodeNumber)
                {
                    default:
                        result = BadRequest();
                        break;
                }

                return result;
            }

            if (getCollectionResult.ResultValue == null)
            {
                result = NotFound();
                return result;
            }

            var metaData = Mapper.Map<CustomField>(source);
            await _collectionService.UpdateCustomFieldAsync(metaData)
                .Success( ()=> result = Ok())
                .Error(err =>
                {
                    switch (err.CodeNumber)
                    {
                        case 404:
                            result = NotFound();
                            break;
                        default:
                            result = BadRequest();
                            break;
                    }
                });

            return result;
        }
        public IHttpActionResult CreateCustomField(CustomFieldModel source)
        {
            IHttpActionResult result = null;

            return result;
        }
        public async Task<IHttpActionResult> CreateCustomFieldAsync(int collectionId, CustomFieldModel source)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IHttpActionResult result = null;

            var metaData = Mapper.Map<CustomField>(source);
            await _collectionService.CreateCustomFieldAsync(collectionId, metaData)
                .Success(metaDataId => result = CreatedAtRoute("GetCustomFieldById", new { collectionId = collectionId, metaDataId = metaDataId }, metaDataId))
                .Error(err =>
                {
                    switch (err.CodeNumber)
                    {
                        case 404:
                            result = NotFound();
                            break;
                        default:
                            result = BadRequest();
                            break;
                    }
                });

            return result;
        }