Exemple #1
0
 public void PutProduct(int id, IniSet product)
 {
     product.Id = id;
     if (!repository.Update(product))
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Exemple #2
0
        public HttpResponseMessage PostProduct(IniSet item)
        {
            item = repository.Add(item);
            var response = Request.CreateResponse <IniSet>(HttpStatusCode.Created, item);

            string uri = Url.Link("DefaultApi", new { id = item.Id });

            response.Headers.Location = new Uri(uri);
            return(response);
        }
Exemple #3
0
        public IniSet GetProduct(int id)
        {
            IniSet item = repository.Get(id);

            if (item == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            return(item);
        }
Exemple #4
0
            public TetraMasterSection() : base(nameof(TetraMasterSection), true)
            {
                ReduceRandom = BindInt32(nameof(ReduceRandom), 1);

                DiscardAutoButton    = BindBoolean(nameof(DiscardAutoButton), true);
                DiscardAssaultCards  = BindBoolean(nameof(DiscardAssaultCards), false);
                DiscardFlexibleCards = BindBoolean(nameof(DiscardFlexibleCards), true);
                DiscardMaxAttack     = BindInt32(nameof(DiscardMaxAttack), 224);
                DiscardMaxPDef       = BindInt32(nameof(DiscardMaxPDef), 255);
                DiscardMaxMDef       = BindInt32(nameof(DiscardMaxMDef), 255);
                DiscardMaxSum        = BindInt32(nameof(DiscardMaxSum), 480);
                DiscardMinDeckSize   = BindInt32(nameof(DiscardMinDeckSize), 10);
                DiscardKeepSameType  = BindInt32(nameof(DiscardKeepSameType), 1);
                DiscardKeepSameArrow = BindInt32(nameof(DiscardKeepSameArrow), 0);
                DiscardExclusions    = BindInt32Set(nameof(DiscardExclusions), DefaultExclusions);
            }