public OperationResult Post(CategoryViewModel categoryViewModel) { var createNewCategoryCommand = new AddCategoryCommand(categoryViewModel.Name); _commandProcessor.Send(createNewCategoryCommand); CategoryViewModel returnedCategoryViewModel = _categoryViewModelRetriever.Get(createNewCategoryCommand.CategoryId); return new OperationResult.Created { ResponseResource = returnedCategoryViewModel, CreatedResourceUrl = returnedCategoryViewModel.CreateUri() }; }
protected bool Equals(CategoryViewModel other) { return Id == other.Id && string.Equals(Name, other.Name); }