コード例 #1
0
        public IActionResult Add([FromBody] PlanningCardsTemplate request)
        {
            var room = new PlanningCardsTemplate();

            repository.Insert(room);
            return(Ok(room.Id));
        }
コード例 #2
0
 public void Update(PlanningCardsTemplate entity)
 {
     if (!_templates.ContainsKey(entity.Id))
     {
         return;
     }
     _templates[entity.Id] = entity;
 }
コード例 #3
0
        public InMemoryCardsTemplateRepository()
        {
            var template = new PlanningCardsTemplate
            {
                Id    = Guid.NewGuid(),
                Name  = "Test template",
                Cards = new HashSet <PlanningCard>(Enumerable.Range(1, 6)
                                                   .Select(num => new PlanningCard
                {
                    Id      = Guid.NewGuid(),
                    Display = num.ToString(),
                    Value   = num.ToString()
                }))
            };

            _templates.TryAdd(template.Id, template);
        }
コード例 #4
0
 public void Insert(PlanningCardsTemplate entity)
 {
     _templates.TryAdd(entity.Id, entity);
 }