AdventureWorks.WebServices.Controllers.CategoryController.NewCategory C# (CSharp) Method

NewCategory() private static method

private static NewCategory ( Category category ) : Category
category AdventureWorks.WebServices.Models.Category
return AdventureWorks.WebServices.Models.Category
        private static Category NewCategory(Category category)
        {
            if (category != null)
            {
                return new Category()
                    {
                        Id = category.Id,
                        Title = category.Title,
                        ParentId = category.ParentId,
                        HasSubcategories = category.HasSubcategories,
                        Subcategories = category.Subcategories,
                        ImageUri = category.ImageUri,
                        Products = category.Products,
                        TotalNumberOfItems = category.TotalNumberOfItems
                    };
            }
            return null;
        }
    }