Esempio n. 1
0
        public HttpResponseMessage CreateCategory(Category category)
        {
            var item = _category.GetFirstOrDefault(z => z.PublicKey == category.PublicKey);

            if (item != null)
            {
                return(ErrorResult("key"));
            }

            category.Id = Guid.NewGuid();
            _category.CreateItem(category);
            return(SuccessResult());
        }