// POST: odata/Currencies
        public IHttpActionResult Post(DimCurrency dimCurrency)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.DimCurrencies.Add(dimCurrency);
            db.SaveChanges();

            return(Created(dimCurrency));
        }
        // DELETE: odata/Currencies(5)
        public IHttpActionResult Delete([FromODataUri] int key)
        {
            DimCurrency dimCurrency = db.DimCurrencies.Find(key);

            if (dimCurrency == null)
            {
                return(NotFound());
            }

            db.DimCurrencies.Remove(dimCurrency);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
        // PUT: odata/Currencies(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <DimCurrency> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            DimCurrency dimCurrency = db.DimCurrencies.Find(key);

            if (dimCurrency == null)
            {
                return(NotFound());
            }

            patch.Put(dimCurrency);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DimCurrencyExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(dimCurrency));
        }